/* Kirchspiel Limbach · kompakte Oberfläche · Stand 16.10.2026
 * Nach style.css und den Fachseiten-Styles laden.
 * 1 Grundlagen, 2 Navigation, 3 Fachseiten, 4 Tablet, 5 Handy, 6 Druck.
 * Fachlogik, Rechnungs-PDFs und E-Mail-Vorlagen verwenden dieses Stylesheet nicht.
 */

/* 1. Grundlagen: kompakter Raum, lesbare Schrift, sichtbare Tastaturbedienung. */
:root {
    --radius: 16px;
    --shadow: 0 5px 20px rgba(15, 23, 42, .07);
    --ui-border: #dce5df;
    --ui-muted: #526475;
    --ui-dock-height: 68px;
}
html { scroll-padding-top: 110px; }
body { line-height: 1.5; }
button, input, select, textarea { font-family: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: rgba(36, 98, 77, .15); }
:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid #ad7e10;
    outline-offset: 3px;
}
button:disabled { cursor: wait; opacity: .65; }
[hidden] { display: none !important; }
img { max-width: 100%; }
.app-shell { font-size: .9375rem; }
.app-shell :where(section, main, article, form, fieldset, .help-content, .verleih-field, .material-content) { min-width: 0; }
.app-shell > section,
.app-shell > main,
.app-shell > .help-page {
    width: min(100%, 1440px);
    margin-inline: auto;
    padding: 28px 28px 40px !important;
}
.app-shell .section-title { text-align: left; margin-bottom: 22px; }
.app-shell .section-title h2 { font-size: clamp(1.45rem, 2.3vw, 2rem); line-height: 1.25; margin-bottom: 6px; }
.app-shell .section-title p { font-size: .95rem; max-width: 75ch; }
.app-shell :where(.portal-card, .package-card, .mobile-rental-card, .help-section) {
    padding: 18px;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
    backdrop-filter: none;
}
.app-shell h2 { font-size: 1.2rem; }
.app-shell h3 { font-size: 1.05rem; }
.app-shell :where(p, small, td, h2, h3, label, summary) { overflow-wrap: anywhere; }
.app-shell .btn { min-height: 40px; padding: 9px 14px; border-radius: 10px; font-size: .875rem; gap: 6px; }
.app-shell .btn-primary { box-shadow: 0 3px 10px rgba(23, 63, 50, .12); }
.app-shell .btn:hover { transform: none; filter: brightness(.97); }
.app-shell .buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.app-shell .buttons > a, .app-shell .buttons > form,
.app-shell .buttons .btn, .app-shell .buttons button { width: auto; min-height: 40px; }
.app-shell .status { padding: 11px 14px; margin-bottom: 16px; border-radius: 10px; }
.app-shell :where(.status-badge, .payment-badge) { padding: 4px 9px; font-size: .78rem; }
.app-shell :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
    min-width: 0; max-width: 100%; padding: 10px 12px; border-radius: 9px; font-size: .9375rem;
}
.app-shell input[type="checkbox"], .app-shell input[type="radio"] { accent-color: var(--green); }
.app-shell summary { cursor: pointer; }
.app-shell .compact-disclosure > summary { font-size: 1rem; font-weight: 750; color: var(--green); }
.app-shell .compact-disclosure[open] > summary { margin-bottom: 14px; }
.app-shell .responsive-table { font-size: .875rem; }
.app-shell .responsive-table :where(th, td) { padding: 10px !important; }
.app-shell .responsive-table tbody tr:hover { background: #f6faf7; }
.skip-link { position: fixed; left: 12px; top: -100px; z-index: 1000000; padding: 12px 16px; background: #fff; color: #173f32; border-radius: 8px; }
.skip-link:focus { top: 10px; }

/* 2. Navigation im Dokumentfluss: auch mehrzeilige Menüs überdecken keinen Inhalt. */
.app-header {
    position: sticky; top: 0; left: 0; padding: 10px 24px;
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px;
    z-index: 100; box-shadow: 0 3px 14px rgba(15, 23, 42, .13);
}
.app-brand { flex: 0 0 auto; }
.app-logo { font-size: 1rem; gap: 8px; }
.app-logo-icon { font-size: 1.45rem; }
.app-logo small { font-size: .7rem; }
.app-nav { gap: 3px; flex: 1 1 780px; justify-content: flex-end; }
.app-nav a { padding: 8px 10px; font-size: .8rem; border-radius: 8px; white-space: nowrap; }
.app-nav a.active { box-shadow: inset 0 -2px 0 var(--gold); }
.app-nav a:hover { transform: none; }
.nav-toggle-text { font-size: .8rem; font-weight: 700; }
.app-dock { display: none; }

/* 3. Fachseiten: Abstände zentral halten, Tabellen und Formulare erhalten ihre Logik. */
.app-shell .features { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 12px; }
.app-shell .feature { padding: 18px; border-radius: 14px; }
.app-shell .feature > span { font-size: 1.8rem; }
.app-shell .feature p { font-size: .875rem; }
.app-shell .verleih-form { gap: 14px; }
.app-shell .verleih-form-summary { font-size: 1.1rem; }
.app-shell .verleih-form-content { margin-top: 16px; }
.app-shell .verleih-form-section { padding: 16px; }
.app-shell .verleih-section-heading { gap: 10px; margin-bottom: 14px; }
.app-shell .verleih-section-heading h3 { font-size: 1rem; }
.app-shell .verleih-section-heading p { font-size: .875rem; }
.app-shell .verleih-form-grid { gap: 12px; }
.app-shell .verleih-position-row { padding: 12px; gap: 10px; border-radius: 12px; }
.app-shell .verleih-admin-option { padding: 10px; border-radius: 10px; }
.app-shell .verleih-table { min-width: 1200px; font-size: .84rem; }
.app-shell .verleih-table :where(td, th) { padding: 10px 8px; }
.app-shell .verleih-table .btn { font-size: .8rem; padding: 8px 10px; }
.app-shell .mobile-rental-header { gap: 8px; flex-wrap: wrap; }
.app-shell .mobile-rental-header > div { flex: 1 1 150px; min-width: 0; }
.app-shell .mobile-rental-meta { margin-bottom: 10px; }
.app-shell .mobile-rental-appointments { margin: 10px 0; gap: 8px; }
.app-shell .mobile-rental-appointments > div { padding: 10px; border-radius: 10px; }
.app-shell .mobile-rental-items { margin: 10px 0; }
.app-shell .mobile-rental-summary { list-style: none; cursor: pointer; }
.app-shell .mobile-rental-summary::-webkit-details-marker { display: none; }
.app-shell .mobile-rental-preview { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; color: var(--ui-muted); font-size: .8rem; }
.app-shell .mobile-rental-preview strong { color: var(--green); }
.app-shell .mobile-rental-preview > span { margin-left: auto; color: var(--green); font-weight: 700; }
.app-shell .mobile-rental-preview > span::after { content: ' ＋'; }
.app-shell .mobile-rental-entry[open] .mobile-rental-preview > span::after { content: ' −'; }
.app-shell .mobile-rental-body { margin-top: 12px; padding-top: 2px; border-top: 1px solid var(--ui-border); }
.app-shell .mobile-rental-entry .mobile-rental-meta { margin: 8px 0; }
.app-shell .mobile-status-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.app-shell .mobile-status-form select { flex: 1 1 140px; }
.app-shell .mobile-status-form button { flex: 0 1 auto; }
.app-shell .material-filter-card { padding: 16px; }
.app-shell .material-grid { gap: 14px; }
.app-shell .material-card { border-radius: 14px; box-shadow: var(--shadow); }
.app-shell .material-image { height: 165px; }
.app-shell .material-content { padding: 16px; }
.app-shell .material-content h3 { font-size: 1.1rem; }
.app-shell .material-description { min-height: 0; margin-bottom: 12px; }
.app-shell .material-stats > div { padding: 9px; }
.app-shell .material-filter-header { gap: 12px; margin-bottom: 14px; }
.app-shell .calendar-day { min-height: 110px; padding: 8px; border-radius: 10px; }
.app-shell .calendar-grid { gap: 7px; }
.app-shell .calendar-head { padding: 6px; }
.app-shell .booking { padding: 7px; margin-bottom: 6px; border-radius: 8px; }
.app-shell .calendar-filter { gap: 8px; }
.app-shell .day-number { margin-bottom: 6px; }
.app-shell .day-date { display: none; }
.app-shell .calendar-day.is-today { border-color: #24624d; box-shadow: inset 0 0 0 1px #24624d; }
.app-shell .help-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 18px; }
.app-shell .help-sidebar { top: 100px; padding: 16px; max-height: calc(100dvh - 120px); overflow-y: auto; border-radius: 14px; }
.app-shell .help-sidebar a { padding: 8px 10px; margin-bottom: 2px; font-size: .875rem; }
.app-shell .help-topics > summary { font-weight: 800; color: var(--green); padding: 4px 0 12px; }
.app-shell .help-content { gap: 16px; }
.app-shell .help-section { padding: 20px; scroll-margin-top: 12px; }
.app-shell .help-card { padding: 14px; }
.app-shell .help-list li { padding: 12px; }
.app-shell .kassenarea { max-width: 1280px; }
.app-shell .kasse-filter { margin-top: 14px; padding: 14px; }
.app-shell .kasse-rechnungsdetails > .kasse-zeile { min-height: 56px; }
.app-shell .kasse-rechnung .btn { min-height: 40px; }
.app-shell .modal-content, .app-shell .modal-card { padding: 22px; border-radius: 16px; max-height: calc(100dvh - 40px); }
.app-shell .modal-overlay, .app-shell .modal { overscroll-behavior: contain; }
.app-shell .modal-card, .app-shell .modal-content, .app-shell .invoice-card { overscroll-behavior: contain; }

/* 4. Tablet: Menü statt gequetschter Kopfzeile. Ohne JS bleiben Links sichtbar. */
@media (max-width: 1199px) {
    .app-header { display: block; padding: 8px 16px; }
    .app-brand { width: 100%; }
    .nav-ready .nav-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 6px 12px; border-radius: 10px; }
    .app-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; max-height: calc(100dvh - 160px); overflow-y: auto; }
    .nav-ready .app-nav { display: none; }
    .nav-ready .app-nav.open { display: grid; }
    .app-nav a { width: auto; white-space: normal; padding: 12px 10px; text-align: left; background: rgba(255,255,255,.08); }
    .app-shell .features { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .app-shell .verleih-desktop-view { display: none !important; }
    .app-shell .verleih-mobile-view { display: block !important; }
    .app-shell .verleih-mobile-view { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
    .app-shell .verleih-mobile-view .mobile-rental-card { margin: 0; }
}
@media (max-width: 900px) {
    .app-shell .help-layout { grid-template-columns: minmax(0, 1fr); }
    .app-shell .help-sidebar { position: static; max-height: none; }
    .app-shell .help-topics > summary { padding-bottom: 4px; }
    .app-shell .help-topics[open] > summary { margin-bottom: 12px; }
    .app-shell .calendar-day { min-height: auto; }
    .app-shell .day-number { display: flex; align-items: center; gap: 8px; }
    .app-shell .day-date { display: inline; font-size: .8rem; color: var(--ui-muted); font-weight: 500; }
    .app-shell .calendar-nav { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px; }
    .app-shell .calendar-nav h2 { grid-column: 1 / -1; grid-row: 1; }
    .app-shell .calendar-filter { display: flex !important; flex-wrap: wrap; align-items: center; }
    .app-shell .calendar-filter > * { width: auto; }
    .app-shell .calendar-filter select { flex: 1 1 80px; }
    .app-shell .calendar-filter .btn { flex: 1 1 130px; }
}

/* 5. Handy: volle Nutzfläche, untere Schnellleiste und beschriftete Listenkarten. */
@media (max-width: 700px) {
    html { scroll-padding-top: 78px; }
    .app-shell { padding-bottom: calc(var(--ui-dock-height) + env(safe-area-inset-bottom)); }
    .app-header { padding: calc(6px + env(safe-area-inset-top)) 12px 6px; }
    .app-logo { font-size: .95rem; }
    .app-logo small { font-size: .68rem; }
    .app-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: calc(100dvh - 170px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
    .app-nav a { min-height: 44px; font-size: .86rem; }
    .app-dock {
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
        position: fixed; inset: auto 0 0; z-index: 90;
        padding: 5px max(6px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
        min-height: var(--ui-dock-height); background: #fff;
        border-top: 1px solid var(--ui-border); box-shadow: 0 -3px 16px rgba(15,23,42,.06);
    }
    .app-dock a, .app-dock button {
        display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px;
        min-width: 0; min-height: 54px; padding: 4px 2px; background: transparent;
        border: 0; border-radius: 10px; color: #526475; text-decoration: none; font: inherit; font-size: .68rem; font-weight: 700; cursor: pointer;
    }
    .app-dock :where(a, button) > span:first-child { font-size: 1.25rem; line-height: 1.3; }
    .app-dock .active, .app-dock [aria-expanded="true"] { background: #edf5ef; color: var(--green); }
    .app-shell.input-focused .app-dock { display: none; }
    .app-shell > section, .app-shell > main, .app-shell > .help-page { padding: 18px 12px 26px !important; }
    .app-shell .section-title { margin-bottom: 16px; }
    .app-shell .feature { padding: 12px !important; }
    .app-shell .feature > span { font-size: 1.5rem; margin-bottom: 8px; }
    .app-shell .feature h3 { font-size: 1rem; }
    .app-shell .feature p { font-size: .8rem; }
    .app-shell .section-title h2 { font-size: 1.45rem; }
    .app-shell .section-title p { font-size: .875rem; }
    .app-shell :where(.portal-card, .package-card, .mobile-rental-card, .help-section, .help-sidebar, .feature) { padding: 14px !important; border-radius: 12px; overflow: visible; }
    .app-shell .btn, .app-shell .buttons .btn, .app-shell .buttons button { min-height: 44px; padding: 10px 12px; }
    .app-shell .buttons { display: flex; gap: 8px; }
    .app-shell .buttons > a, .app-shell .buttons > form { flex: 1 1 125px; }
    .app-shell .buttons > form > .btn { width: 100%; }
    .app-shell :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) { font-size: 16px !important; min-height: 44px; }
    .app-shell :where(input[type="checkbox"], input[type="radio"]) { min-width: 18px; min-height: 18px; }
    .app-shell .verleih-mobile-view { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .app-shell .verleih-form-section { padding: 12px !important; }
    .app-shell .verleih-position-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-shell .verleih-position-article { grid-column: 1 / -1; }
    .app-shell .verleih-position-quantity, .app-shell .verleih-position-total { grid-column: 1; }
    .app-shell .verleih-position-price, .app-shell .verleih-position-remove { grid-column: 2; }
    .app-shell .verleih-section-icon { width: 32px; height: 32px; font-size: 1.1rem; border-radius: 9px; }
    .app-shell .mobile-rental-appointments { grid-template-columns: repeat(2, minmax(0, 1fr)); font-size: .82rem; }
    .app-shell .mobile-rental-actions .btn { width: auto; }
    .app-shell .mobile-rental-actions form { width: auto; }
    .app-shell .mobile-status-form select, .app-shell .mobile-status-form button { width: auto; }
    .app-shell .verleih-filterbar { padding: 12px !important; grid-template-columns: minmax(0, 1fr); }
    .app-shell .verleih-filterbar > label:first-child, .app-shell .verleih-filter-actions { grid-column: 1 / -1; }
    .app-shell .material-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-shell .material-field-search, .app-shell .material-filter > .material-field:first-child { grid-column: 1 / -1; }
    .app-shell .material-grid { grid-template-columns: minmax(0, 1fr); }
    .app-shell .material-image { height: 150px; }
    .app-shell .material-period-badge { white-space: normal; }
    .app-shell .help-section { scroll-margin-top: 8px; }
    .app-shell .responsive-table.table-labelled { display: block; width: 100% !important; min-width: 0 !important; }
    .app-shell .responsive-table.table-labelled thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .app-shell .responsive-table.table-labelled tbody { display: grid; gap: 10px; }
    .app-shell .responsive-table.table-labelled tr { display: block; border: 1px solid var(--ui-border); border-radius: 10px; background: #fff; padding: 10px; }
    .app-shell .responsive-table.table-labelled td { display: block; min-width: 0 !important; width: auto !important; padding: 7px 0 !important; border: 0 !important; }
    .app-shell .responsive-table.table-labelled td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 700; color: var(--ui-muted); margin-bottom: 3px; }
    .app-shell .responsive-table.table-labelled td:first-child { padding-top: 0 !important; font-weight: 700; }
    .app-shell .responsive-table.table-labelled td:last-child { padding-bottom: 0 !important; }
    .app-shell .responsive-table :where(form, input, select, textarea) { max-width: 100%; }
    .app-shell .responsive-table form { flex-wrap: wrap; }
    .app-shell .modal, .app-shell .modal-overlay { padding: 8px; align-items: center; }
    .app-shell .modal-content, .app-shell .modal-card, .app-shell #invoiceModal .invoice-card { max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 16px; border-radius: 14px; }
    .app-shell #invoiceModal { padding: 8px; }
    .app-shell #invoiceModal .invoice-section { padding: 12px; margin-top: 12px; }
    .app-shell #invoiceModal .invoice-actions { gap: 8px; }
    .app-shell .kasse-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-shell .kasse-filter-grid > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }

    /* Öffentliche Seiten: kurze Kopfzeile statt einer ganzen Bildschirmhöhe Menü. */
    .public-shell > header:not(.app-header) { position: static; padding: 12px; gap: 10px; }
    .public-shell > header:not(.app-header) .logo { white-space: normal; font-size: 1rem; text-align: center; }
    .public-shell > header:not(.app-header) nav { display: flex; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 7px; width: 100%; padding: 3px; }
    .public-shell > header:not(.app-header) nav a { flex: 0 0 auto; min-height: 44px; padding: 10px 12px; white-space: nowrap; font-size: .875rem; border-radius: 10px; }
    .public-shell > header:not(.app-header) nav .btn { width: auto !important; min-width: auto; margin: 0; }
    .public-shell > .hero { padding: 28px 14px !important; min-height: auto; }
    .public-shell .hero h1 { font-size: clamp(2rem, 8vw, 3rem); line-height: 1.12; }
    .public-shell .hero p { font-size: 1rem; }
    .public-shell > section { padding: 28px 14px !important; }
    .public-shell .portal-card { padding: 18px !important; border-radius: 14px; }
    .public-shell :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) { font-size: 16px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 6. Druck: Bedienelemente und feste Schnellleiste niemals mitdrucken. */
@media print {
    .app-header, .app-dock, .skip-link, .nav-toggle { display: none !important; }
    .app-shell { padding-bottom: 0; }
    .app-shell > section, .app-shell > main { width: 100%; max-width: none; padding: 0 !important; }
    .app-shell .help-sidebar { display: none; }
    .app-shell .help-layout { display: block; }
}
