/* Verwaltung Pfarre Kagraner Anger */

:root {
    --ink: #1c2130;
    --text: #2d3342;
    --muted: #687080;
    --line: #e4e0d8;
    --bg: #f5f3ef;
    --primary: #2f3a8f;
    --primary-hover: #252e75;
    --danger: #b42323;
    --rainbow: linear-gradient(90deg, #e23b3b, #f08a1c, #f2be1a, #3a9e4f, #2a7fd0, #4650b3, #934bb4);
}

.c-red { --c: #e23b3b; }
.c-orange { --c: #f08a1c; }
.c-yellow { --c: #f2be1a; }
.c-green { --c: #3a9e4f; }
.c-blue { --c: #2a7fd0; }
.c-indigo { --c: #4650b3; }
.c-violet { --c: #934bb4; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--primary); }
h1, h2 { color: var(--ink); line-height: 1.25; }
h1 { font-size: 1.7rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
code { background: #eeebe5; padding: 1px 5px; border-radius: 4px; font-size: .88em; }

.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; text-decoration: none; }
.strong:hover { text-decoration: underline; }

:focus-visible { outline: 3px solid #2a7fd0; outline-offset: 2px; }

.rainbow { height: 5px; background: var(--rainbow); }

/* Top bar */

.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; max-width: 1240px; margin: 0 auto; padding: 8px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; }
.brand span { line-height: 1.2; }
.menu { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.menu a { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 600; font-size: .94rem; }
.menu a:hover { background: var(--bg); }
.menu a[aria-current="page"] { background: var(--ink); color: #fff; }
.who { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.who form { margin: 0; }
.site-link { font-weight: 600; text-decoration: none; }
.me { color: var(--muted); }

.main { max-width: 1240px; margin: 0 auto; padding: 26px 20px 60px; }

.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.back { display: inline-block; font-size: .9rem; text-decoration: none; margin-bottom: 4px; }

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--line);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: #efc6c6; }
.btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 4px 10px; font-size: .85rem; border-radius: 8px; }
.btn.wide { width: 100%; justify-content: center; padding: 12px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; }
.linkish.danger { color: var(--danger); }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 28px; height: 26px; cursor: pointer; }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* Messages */

.flash { padding: 11px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.flash.success { background: #e5f4e8; color: #1e5f2d; }
.flash.error { background: #fde4e4; color: #8a1c1c; }
.flash.info { background: #e8f0fb; color: #1b4a80; }
.ok { color: #1e5f2d; font-weight: 600; }

.tag { display: inline-block; font-style: normal; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #eee; }
.tag.red { background: #fde4e4; color: #8a1c1c; }
.tag.green { background: #e5f4e8; color: #1e5f2d; }
.tag.blue { background: #e8f0fb; color: #1b4a80; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #ccc); margin-right: 7px; flex: none; }

/* Panels */

.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stats > * { flex: 1; min-width: 160px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; text-decoration: none; color: var(--muted); }
.stats strong { display: block; font-size: 1.8rem; color: var(--ink); line-height: 1.2; }

.todo { list-style: none; margin: 0 0 12px; padding: 0; }
.todo li { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.todo li > span:last-child { flex: 1; }
.todo li:has(.btn) > span { flex: 1; }

.help ol { margin: 0; padding-left: 1.3em; }
.help li { margin-bottom: 6px; }

/* Lists */

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.tabs a { padding: 6px 14px; border-radius: 7px; text-decoration: none; font-weight: 600; color: var(--text); }
.tabs a[aria-current="page"] { background: var(--ink); color: #fff; }
.toolbar .search { display: flex; gap: 8px; }
.toolbar input[type="search"] { padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; min-width: 240px; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.panel .table-wrap { border: 0; border-radius: 0; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfaf8; }
table.list td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.is-cancelled td { opacity: .6; }
table.list.edit td { padding: 6px 8px; }
table.list.edit input, table.list.edit select { width: 100%; padding: 7px 9px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; min-width: 90px; }
table.list.edit .new-row input[type="text"] { background: #fbfaf8; }

/* Forms */

.form { display: flex; flex-direction: column; gap: 16px; }
.narrow-form { max-width: 560px; }
.form label, .stack label { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: .9rem; color: var(--ink); }
.form .opt { font-weight: 500; color: var(--muted); font-size: .8rem; }
.form input[type="text"], .form input[type="email"], .form input[type="password"], .form input[type="date"],
.form input[type="time"], .form input[type="number"], .form select, .form textarea,
.stack input {
    font: inherit;
    font-weight: 400;
    padding: 10px 12px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    width: 100%;
}
.form textarea { resize: vertical; line-height: 1.55; }
.form input:focus, .form select:focus, .form textarea:focus, .stack input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(47, 58, 143, .15); }
.form .row { display: flex; gap: 14px; flex-wrap: wrap; }
.form .row > label { min-width: 150px; }
.form .row > .grow { flex: 1; min-width: 220px; }
.form .narrow { width: 100px; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
.form label.check input { width: 18px; height: 18px; }
.hint { margin: -8px 0 0; font-size: .84rem; color: var(--muted); }
.form-actions { display: flex; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 16px; }
.section-title { margin: 10px 0 -4px; padding-top: 14px; border-top: 1px solid var(--line); }
.section-title:first-of-type { border-top: 0; padding-top: 0; }
.repeat { background: #fbfaf8; border-radius: 10px; padding: 12px 14px; }

.step { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin: 6px 0 0; }
.step span { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .9rem; }
#bericht { padding-top: 18px; border-top: 1px solid var(--line); margin-top: 8px; }

/* Photos */

.dropzone { position: relative; margin: 14px 0 18px; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-label { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 26px 20px; border: 2px dashed #cfc9bd; border-radius: 14px; background: #fbfaf8; cursor: pointer; }
.drop-label strong { color: var(--primary); }
.dropzone.is-over .drop-label, .drop-label:hover { border-color: var(--primary); background: #f0f1fa; }
.dropzone input:focus-visible + .drop-label { outline: 3px solid #2a7fd0; }
.js .no-js-only { display: none; }
.no-js-only { margin-top: 10px; }
.progress { margin-top: 12px; background: #eeebe5; border-radius: 999px; height: 26px; position: relative; overflow: hidden; }
.progress .bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--rainbow); transition: width .2s; }
.progress-text { position: relative; display: block; text-align: center; font-size: .85rem; font-weight: 700; line-height: 26px; color: var(--ink); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photo { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.photo.is-cover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.cover-badge { position: absolute; top: 8px; left: 8px; background: var(--primary); color: #fff; font-size: .74rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.caption-form { display: flex; gap: 6px; padding: 8px; }
.caption-form input { flex: 1; min-width: 0; padding: 5px 8px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; font-size: .88rem; }
.photo-actions { display: flex; align-items: center; gap: 8px; padding: 0 8px 10px; }
.photo-actions form { margin: 0; }
.photo-actions form:nth-last-child(1) { margin-left: auto; }

.danger-zone { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.danger-zone form { margin: 0; }

/* Login */

body.bare { background: var(--bg); }
.login-box { max-width: 400px; margin: 7vh auto 40px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px 32px 34px; }
.login-logo { display: block; margin: 0 auto 14px; }
.login-box h1 { text-align: center; }
.login-box > .muted { text-align: center; margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }

@media (max-width: 860px) {
    .grid-2 { grid-template-columns: 1fr; }
    .who .me { display: none; }
    .main { padding: 18px 14px 50px; }
    .toolbar input[type="search"] { min-width: 0; width: 100%; }
    .toolbar .search { width: 100%; }
}
.photo-actions .linkish { white-space: nowrap; }
