:root {
    --blue: #174AA1;
    --blue-600: #0d3a7a;
    --accent: #A1174A;
    --bg: #f8f9fa;
    --text: #1a1a1a;
    --muted: #666;
    --radius: 12px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .08);
    --shadow-md: 0 8px 24px rgba(23, 74, 161, .12);
    --ring: 0 0 0 3px rgba(23, 74, 161, .25);
    --link: #174AA1;
    /* brand blue */
    --link-hover: #A1174A;
    /* accent on hover (matches your UI) */
    --link-focus: rgba(23, 74, 161, .25);

}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

a:active {
    opacity: .9;
}

a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--link-focus);
    border-radius: 4px;
}

/* Optional: make “static field” links slightly stronger (Mutterloge) */
.field-static a {
    font-weight: 500;
}

html,
body {
    height: 100%;
    overflow: hidden
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f4f4f4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text);
}

.main {
    display: grid;
    grid-template-columns: 130px 1fr;
    height: 100vh
}

/* ====== Mobile Top Bar (new) ====== */
.topbar {
    display: none;
    transition: transform .36s cubic-bezier(.2, .7, .2, 1);
    will-change: transform;
}

.topbar__inner {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center
}

.topbar__logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none
}

.topbar__logo svg {
    height: 28px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1)
}

.topbar__left {
    position: absolute;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 8px
}

.topbar--hidden {
    transform: translateY(-100%)
}


/* Mobile Menu Toggle (restyled to live in topbar) */
.menu-toggle {
    display: none;
    /* becomes flex in mobile via media query */
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    position: relative;
    border-radius: 10px;
    cursor: pointer;
}

.menu-toggle span {
    position: absolute;
    left: 9px;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}

.menu-toggle span:nth-child(1) {
    top: 12px;
}

.menu-toggle span:nth-child(2) {
    top: 19px;
}

.menu-toggle span:nth-child(3) {
    top: 26px;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Sidebar Navigation */
.navbar {
    background: var(--blue);
    color: #fff;
    padding: 25px 15px;
    box-shadow: 4px 0 12px rgba(0, 0, 0, .1);
    overflow-y: auto
}

.left-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 40px;
    box-shadow: 0 4px 16px rgba(255, 255, 255, .3);
    transition: transform .3s ease
}

.left-logo:hover {
    transform: scale(1.05)
}

.left-logo svg {
    max-width: 55px;
    max-height: 55px
}

.navbar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0
}

.navbar li {
    position: relative;
    border-bottom: none;
}

.navbar li::after {
    content: "";
    display: block;
    height: 1px;
    background: rgba(255, 255, 255, .15);
    width: 60%;
    margin: 0 auto;
}

.navbar li:last-child::after {
    display: none;
}

.navbar li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    color: rgba(255, 255, 255, .92);
    text-decoration: none;
    transition: all .2s ease;
    font-size: 12px;
    text-align: center;
    font-weight: 400
}

.navbar li a:hover {
    background: rgba(255, 255, 255, .10);
    color: #fff
}

.navbar li a svg {
    width: 26px;
    height: 26px;
    fill: white;
}

.navbar li a.active svg {
    fill: #FBC02D
}

.navbar li a.active {
    color: #FBC02D
}

/* Main Content */
.main-content {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px;
    background-color: var(--bg)
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px
}

h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -.5px
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    background: #fff;
    border-radius: 25px;
    box-shadow: var(--shadow-sm);
    font-size: 14px
}

.user-info a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 500
}

/* Start header grid */
.start-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px
}

/* ====== Classy Blockquote (updated) ====== */
blockquote {
    background: #fff;
    font-family: 'EB Garamond', Georgia, serif;
    font-size: clamp(18px, 2.2vw, 22px);
    line-height: 1.75;
    color: #222;
    padding: 36px 44px 32px 64px;
    border: 1px solid #e6eaf5;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    position: relative;
    font-style: italic;
    max-width: 720px;
    margin: 0;
    isolation: isolate;
}

blockquote::before {
    content: "“";
    position: absolute;
    left: 18px;
    top: 6px;
    font-size: 72px;
    line-height: 1;
    color: rgba(23, 74, 161, .18);
    font-weight: 700;
    font-family: 'EB Garamond', serif;
}

blockquote::after {
    content: "";
    position: absolute;
    right: 22px;
    bottom: 18px;
    width: 64px;
    height: 2px;
    background: linear-gradient(90deg, rgba(23, 74, 161, .35), rgba(161, 23, 74, .35));
    border-radius: 2px;
}

blockquote p {
    margin: 0;
    font-weight: 400;
    letter-spacing: .2px
}

/* remove heavy drop-cap for a cleaner, posher feel */
blockquote p::first-letter {
    all: unset
}

/* Search */
.search-container {
    display: flex;
    justify-content: center;
    align-items: center
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    padding: 12px 24px;
    box-shadow: var(--shadow-sm);
    transition: all .2s ease;
    max-width: 500px;
    width: 100%
}

.search-box:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(23, 74, 161, .12), var(--shadow-sm)
}

.search-box svg {
    width: 22px;
    height: 22px;
    fill: #666;
    flex-shrink: 0
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    width: 100%;
    color: #333;
    font-family: 'Inter', sans-serif
}

/* Cards & Events */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(23, 74, 161, .12);
    margin-bottom: 30px;
    overflow: hidden;
    border: 1px solid #e7ecf8
}

.event-list {
    display: flex;
    flex-direction: column
}

.event-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    padding: 20px 24px;
    border-bottom: 1px solid #eef1f7;
    transition: background .2s ease;
    align-items: start
}

.event-item:nth-child(even) {
    background: #fbfcfe
}

.event-item:hover {
    background: #f3f6fc
}

.event-item:last-child {
    border-bottom: none
}

.event-star {
    display: flex;
    align-items: center;
    padding-top: 2px
}

.star-checkbox {
    cursor: pointer
}

.star-checkbox input {
    display: none
}

.star-checkbox span {
    display: block;
    width: 24px;
    height: 24px;
    background: url('/image/star-inactive.svg') no-repeat center/contain;
    transition: transform .2s ease
}

.star-checkbox:hover span {
    transform: scale(1.08)
}

.star-checkbox input:checked+span {
    background: url('/image/star-active.svg') no-repeat center/contain
}

.event-details {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.event-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue);
    letter-spacing: -.2px
}

.event-description {
    font-size: 15px;
    color: #333;
    line-height: 1.5;
    font-weight: 400
}

.event-lodge {
    font-size: 13px;
    color: var(--muted);
    font-weight: 400
}

.event-lodge a {
    color: var(--blue);
    text-decoration: none
}

.event-lodge a:hover {
    color: var(--accent);
    text-decoration: underline
}

h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    margin: 40px 0 20px;
    letter-spacing: -.3px
}

/* Registration */
.registration-list {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid #e7ecf8
}

.registration-item {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px
}

.registration-item:last-child {
    border-bottom: none
}

.registration-info {
    flex: 1
}

.registration-info strong {
    color: #333;
    display: block;
    margin-bottom: 4px;
    font-weight: 500
}

.registration-info small {
    color: #666;
    font-size: 13px;
    font-weight: 400;
    display: block;
    line-height: 1.35;
}

.btn-confirm {
    padding: 8px 20px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block
}

.btn-confirm:hover {
    background: var(--blue-600)
}

.btn-confirm:focus-visible {
    outline: none;
    box-shadow: var(--ring)
}

.registration-info .reg-lodge {
    color: #444;
}

/* Calendar subscription */
.calendar-subscription {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    border: 1px solid #e7ecf8
}

.calendar-subscription p {
    line-height: 1.6;
    color: #555;
    margin-bottom: 16px;
    font-weight: 400
}

.calendar-link {
    display: inline-block;
    padding: 12px 24px;
    background: #f8f9fa;
    border: 2px dashed var(--blue);
    border-radius: 8px;
    color: var(--blue);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    word-break: break-all;
    transition: all .2s ease
}

.calendar-link:hover {
    background: var(--blue);
    color: #fff
}

.calendar-copy {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.calendar-link {
    flex: 1;
    white-space: normal;
    /* wrap naturally */
    overflow-wrap: anywhere;
    /* very long personal links */
}

.btn-copy {
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e7ecf8;
    border-radius: 8px;
    font: 500 14px 'Inter', sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.btn-copy:hover {
    background: #f5f7fb;
}

.btn-copy:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(23, 74, 161, .25);
}


/* Lodge cards */
.lodge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px
}

.lodge-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    padding: 24px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(161, 23, 74, .2);
    transition: all .2s ease
}

.lodge-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(161, 23, 74, .3);
    color: #fff;
    /* verhindert globales a:hover-Farben */
    text-decoration: none;

}


.lodge-card h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 auto 0;
    letter-spacing: -.2px
}

.lodge-card p {
    font-size: 13px;
    margin: 0;
    opacity: .92;
    text-align: right;
    font-weight: 400
}

/* Modal */
#confirmModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
    z-index: 1000;
    max-width: 400px;
    width: 90%
}

#confirmModal form {
    display: flex;
    flex-direction: column;
    gap: 12px
}

#confirmModal label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400
}

#confirmModal select,
#confirmModal input[type="submit"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif
}

#confirmModal input[type="submit"] {
    background: var(--blue);
    color: #fff;
    border: none;
    cursor: pointer;
    margin-top: 12px;
    font-weight: 500
}

#confirmModal input[type="submit"]:hover {
    background: var(--blue-600)
}

/* Flash */
#flash {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px;
    text-align: center;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .2);
    z-index: 2000;
    animation: slideDown .3s ease;
    font-weight: 500
}

@keyframes slideDown {
    from {
        transform: translateY(-100%)
    }

    to {
        transform: translateY(0)
    }
}

/* ====== Responsive ====== */
@media (max-width:1024px) {
    .start-header {
        grid-template-columns: 1fr
    }
}

@media (max-width:768px) {

    /* Topbar visible on mobile */
    .left-logo {
        display: none;
    }

    .topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: var(--blue);
        color: #fff;
        z-index: 1002;
        display: block;
        transform: translateY(0);
        transition: transform .28s ease;
        box-shadow: 0 2px 12px rgba(0, 0, 0, .2)
    }

    .menu-toggle {
        display: flex
    }

    .main {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr
    }

    .navbar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1001;
        transition: left .3s ease;
        padding: 96px 20px 20px
    }

    .navbar.active {
        left: 0
    }

    .main-content {
        padding: 88px 20px 20px
    }

    /* leaves room for topbar */
    h1 {
        font-size: 22px
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px
    }

    .user-info {
        display: none
    }

    /* keep header clean on mobile */

    .event-item {
        gap: 12px;
        padding: 16px
    }

    .lodge-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px
    }

    .lodge-card {
        min-height: 140px;
        padding: 16px
    }

    .lodge-card h3 {
        font-size: 14px
    }

    .lodge-card p {
        font-size: 12px
    }

    blockquote {
        padding: 28px 28px 26px 52px;
        font-size: 18px;
        max-width: 100%
    }

    blockquote::before {
        font-size: 64px;
        left: 14px;
        top: 2px
    }
}

@media (max-width:480px) {
    .main-content {
        padding: 88px 15px 15px
    }

    .lodge-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px
    }

    .lodge-card {
        min-height: 120px;
        padding: 14px
    }

    .lodge-card h3 {
        font-size: 13px;
        line-height: 1.3
    }

    blockquote {
        padding: 24px 22px 22px 48px;
        font-size: 16px
    }

    .calendar-copy {
        flex-direction: column;
    }

    .btn-copy {
        width: 100%;
    }

}

/* Overlay for mobile menu */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 999
}

.menu-overlay.active {
    display: block
}

/* Focus styles */
a:focus-visible,
.btn-confirm:focus-visible,
.calendar-link:focus-visible,
.menu-toggle:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: 8px
}

@media (prefers-reduced-motion:reduce) {
    * {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important
    }
}






/* ===== Forms on cards (Profile) ===== */
.form-card {
    padding: 20px 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #174AA1;
    letter-spacing: -0.2px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
    appearance: none;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e7ecf8;
    border-radius: 10px;
    background: #fff;
    font: 400 15px 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: #1a1a1a;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.form-group select {
    background-image:
        linear-gradient(45deg, transparent 50%, #7a8ab3 50%),
        linear-gradient(135deg, #7a8ab3 50%, transparent 50%),
        linear-gradient(to right, #e7ecf8, #e7ecf8);
    background-position:
        calc(100% - 22px) 16px,
        calc(100% - 16px) 16px,
        calc(100% - 44px) 50%;
    background-size: 6px 6px, 6px 6px, 1px 60%;
    background-repeat: no-repeat;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #174AA1;
    box-shadow: 0 0 0 3px rgba(23, 74, 161, .12);
}

.field-static {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 10px 0;
    color: #333;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    font: 600 14px 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    transition: background .2s ease, box-shadow .2s ease, transform .02s ease;
}

.btn-primary {
    background: #174AA1;
    color: #fff;
    border-color: #174AA1;
    box-shadow: 0 2px 10px rgba(23, 74, 161, .18);
}

.btn-primary:hover {
    background: #0d3a7a;
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(23, 74, 161, .25);
}

/* Headings spacing inside main-content is already set; just ensure nice rhythm */
.main-content h2 {
    margin-top: 28px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}














/* ===== Status badge ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font: 600 12px 'Inter', sans-serif;
    border: 1px solid #e7ecf8;
    background: #fff;
    color: #174AA1;
}

.status-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #174AA1;
}

.status-badge.is-available {
    color: #0c8a2a;
    border-color: #e6f3ea;
    background: #f6fbf7;
}

.status-badge.is-available::before {
    background: #0c8a2a;
}

.status-badge.is-borrowed {
    color: #b01919;
    border-color: #f5e6e6;
    background: #fef7f7;
}

.status-badge.is-borrowed::before {
    background: #b01919;
}

.status-badge.is-draft {
    color: #7a8ab3;
    background: #f6f8ff;
    border-color: #e7ecf8;
}

.status-badge.is-draft::before {
    background: #7a8ab3;
}

/* ===== Book list ===== */
.book-list {
    display: grid;
    gap: 16px;
    margin-top: 12px;
}

.book-row {
    padding: 16px;
}

.book-row__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.book-row__actions {
    display: flex;
    gap: 10px;
}

.book-fields {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

@media (max-width: 1200px) {
    .book-fields {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .book-fields {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .book-fields {
        grid-template-columns: 1fr;
    }
}

/* Keep inputs consistent with profile.css we added earlier */
.book-fields .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #174AA1;
    letter-spacing: -.2px;
}

.book-fields .form-group input {
    width: 100%;
}

/* ===== Icon buttons (borrow/delete) ===== */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e7ecf8;
    background: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s ease, box-shadow .2s ease, transform .02s;
}

.icon-btn:hover {
    background: #f7f9fe;
}

.icon-btn:active {
    transform: translateY(1px);
}

.icon-btn img {
    width: 22px;
    height: 22px;
}

/* ===== Modal (borrow) ===== */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1100;
}

.modal--open {
    display: block;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
}

.modal__dialog {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin: 8vh auto;
    padding: 20px 24px;
}

.modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 18px;
    line-height: 1;
}

.modal__section {
    margin: 12px 0 8px;
}

.scroll-area-160 {
    max-height: 160px;
    overflow: auto;
}

.list-plain {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.list-plain li {
    padding: 6px 0;
    border-bottom: 1px solid #eef1f7;
}

.list-plain li:last-child {
    border-bottom: none;
}

/* Optional: tighten the card inside the modal */
.modal .card {
    border: 1px solid #e7ecf8;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}

/* Actions bar reuse */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}


.book-list {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.book-list--dense {
    gap: 8px;
}

/* Compact foldable row (not a full card) */
.book-row {
    border: 1px solid #e7ecf8;
    border-radius: 10px;
    background: #fff;
}

.book-row__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
}

.book-row__summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    /* ellipsis support */
    font-size: 14px;
}

.book-row__summary .book-title {
    font-weight: 600;
    color: #1a1a1a;
}

.book-row__summary .book-author {
    color: #333;
}

.book-row__summary .book-meta {
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-row__summary .sep {
    color: #b0b8cc;
}

.book-row__actions {
    display: flex;
    gap: 6px;
}

/* Toggle button */
.row-toggle {
    width: 32px;
    height: 32px;
    border: 1px solid #e7ecf8;
    border-radius: 8px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s ease, transform .02s;
}

.row-toggle:hover {
    background: #f7f9fe;
}

.row-toggle:active {
    transform: translateY(1px);
}

.row-toggle .chev {
    width: 18px;
    height: 18px;
    transform: rotate(-90deg);
    transition: transform .18s ease;
    fill: #7a8ab3;
}

.book-row.is-open .row-toggle .chev {
    transform: rotate(0deg);
}

/* Fields (collapsed by default) */
.book-fields {
    display: none;
    padding: 10px 10px 12px;
    border-top: 1px solid #eef1f7;
}

.book-row.is-open .book-fields {
    display: grid;
}

.book-fields {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px 14px;
}

@media (max-width:1200px) {
    .book-fields {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width:900px) {
    .book-fields {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:520px) {
    .book-fields {
        grid-template-columns: 1fr;
    }
}

/* Tighten form controls for density */
.book-fields .form-group {
    gap: 6px;
}

.book-fields .form-group input {
    padding: 10px 12px;
}

.book-fields .form-group label {
    font-size: 12px;
}

/* Top actions spacing */
.form-actions--top {
    margin: 0 0 8px;
}

/* Status badge stays small */
.status-badge {
    padding: 4px 8px;
    font-size: 11px;
}

.status-badge::before {
    width: 6px;
    height: 6px;
}

/* Modal adjustments (no heavy card) */
.modal__dialog {
    background: #fff;
    border: 1px solid #e7ecf8;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
    padding: 20px 24px;
    max-width: 560px;
    margin: 8vh auto;
    position: relative;
}


/* ===== Admin lists (Email Verwaltung) ===== */
.admin-list {
    display: grid;
    gap: 10px;
    /* tighter than default for a professional, dense look */
}

.admin-row {
    border: 1px solid #e7ecf8;
    border-radius: 10px;
    background: #fff;
    padding: 12px;
    /* compact */
}

.admin-grid {
    display: grid;
    gap: 12px 16px;
}

.admin-grid--3 {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.admin-grid--2 {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

@media (max-width: 1024px) {
    .admin-grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {

    .admin-grid--3,
    .admin-grid--2 {
        grid-template-columns: 1fr;
    }
}

/* Reuse existing .form-card spacing */
.form-card {
    padding: 18px 20px;
}

/* Textarea auto-resize baseline */
.auto-resize {
    overflow: hidden;
    /* no scrollbars */
    resize: none;
    /* user resizer off; JS handles height */
}


/* ===== Lodge toolbar ===== */
.lodge-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -4px 0 10px 0;
}

.toolbar-label {
    color: #555;
    font-size: 14px;
}

/* ===== Lodge media (Bijou) ===== */
.lodge-media {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.bijou-img {
    max-width: 220px;
    height: auto;
    display: block;
    border-radius: 10px;
    border: 1px solid #e7ecf8;
}

.lodge-media__upload {
    min-width: 220px;
}

/* Make some fields full width when needed */
.form-group--full {
    grid-column: 1 / -1;
}

/* ===== Arbeitsplan (calendar) as dense grid ===== */
.lodge-plan__header {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    margin: 8px 0 8px;
}

.download-link {
    font-weight: 500;
}



/* ===== Details list (reuse admin styles) ===== */
.admin-grid--4 {
    grid-template-columns: 1.2fr 2fr 1.2fr 1.2fr;
}

@media (max-width:1024px) {
    .admin-grid--4 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width:640px) {
    .admin-grid--4 {
        grid-template-columns: 1fr;
    }
}

/* Error text for contact form */
.form-error {
    color: #A1174A;
    margin: 6px 0 10px;
}

/* Small toolbar link reuse */
.toolbar {
    margin-top: 10px;
}

/* ===== Dates (Nächsten Termine) ===== */
.date-list {
    display: grid;
    gap: 8px;
    padding: 12px 16px;
}

.date-item {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 14px;
}

.date-item__date {
    min-width: 88px;
    font-weight: 600;
    color: #174AA1;
}

.date-item__label {
    color: #333;
}

/* ===== Data cards / tables ===== */
.data-card {
    padding: 0;
}

/* tighter cards for tables */
.table {
    overflow: auto;
    /* responsive: horizontal scroll if needed */
    border-radius: 12px;
    border: 1px solid #e7ecf8;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    font-size: 14px;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    /* sticky header inside .table scroll */
    background: #f7f9fe;
    color: #174AA1;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e7ecf8;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f2f8;
    color: #1a1a1a;
    white-space: nowrap;
    /* keep columns compact (like original) */
}

.data-table tbody tr:hover td {
    background: #fbfcff;
}

/* Sort indicators via [data-asc] */
.data-table thead th {
    user-select: none;
}

.data-table thead th::after {
    content: "";
    margin-left: 6px;
    border: 5px solid transparent;
    display: inline-block;
    transform: translateY(-1px);
}

.data-table thead th[data-asc="true"]::after {
    border-bottom-color: #7a8ab3;
    /* up arrow */
}

.data-table thead th[data-asc="false"]::after {
    border-top-color: #7a8ab3;
    /* down arrow */
}

/* ===== Memberships cell styling ===== */
.membership-item {
    padding: 8px 10px;
    border: 1px solid #eef1f7;
    border-radius: 8px;
    background: #fff;
    margin: 6px 0;
}

.membership-item__line {
    font-weight: 500;
}

.membership-item__dates {
    font-size: 12px;
    color: #666;
    padding-left: 18px;
}

.membership-item[data-warning="1"] {
    background: #fff7eb;
    border-color: #ffd9ae;
}

/* Smaller screens: allow wrapping inside cells that can be long */
@media (max-width: 680px) {

    .data-table thead th,
    .data-table tbody td {
        white-space: normal;
        /* allow wrap on very small screens */
    }
}






/* ===== Downloads grid ===== */
.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

/* Download card (compact, professional) */
.download-card {
    border: 1px solid #e7ecf8;
    border-radius: 12px;
    background: #fff;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.download-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(23, 74, 161, .10);
    border-color: #dfe7f7;
}

.download-card:focus-within {
    box-shadow: 0 0 0 3px rgba(23, 74, 161, .18), 0 8px 20px rgba(23, 74, 161, .10);
}

/* Header */
.download-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.download-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.35;
}

/* Meta */
.download-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.download-date {
    font-size: 13px;
    color: #174AA1;
    font-weight: 600;
}

.download-author {
    font-size: 14px;
    color: #333;
}

.download-lodge .meta-link {
    font-size: 12px;
    color: #666;
}

.download-lodge .meta-link:hover {
    color: #444;
    text-decoration: underline;
}

/* Download icon button (reuses icon-btn sizing but in brand color) */
.icon-btn--download {
    color: #174AA1;
}

.icon-btn--download svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: currentColor;
}

.icon-btn--download:hover {
    background: #f7f9fe;
}

/* ===== Logenliste – neighbours disclosure ===== */
.neighbors-cell details {
    display: inline-block;
}

.neighbors-cell summary {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--link, #174AA1);
    font-weight: 500;
    list-style: none;
}

.neighbors-cell summary::-webkit-details-marker {
    display: none;
}

.neighbors-cell summary::after {
    content: "▾";
    font-size: 12px;
    line-height: 1;
    transition: transform .18s ease;
}

.neighbors-cell details[open] summary::after {
    transform: rotate(180deg);
}

.neighbors-list {
    margin: .5rem 0 0;
    padding-left: 0;
    list-style: none;
    max-width: 42ch;
}

.neighbors-list li {
    padding: 4px 0;
    border-bottom: 1px solid #eef1f7;
    color: #333;
}

.neighbors-list li:last-child {
    border-bottom: none;
}


/* ===== Calendar editor layout ===== */
.calendar-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.toolbar-spacer {
    flex: 1 1 auto;
}

/* Make the data table comfortable for touch + scrolling on mobile */
.calendar-table input {
    width: 100%;
    min-width: 160px;
    padding: 10px 12px;
    border: 1px solid #e7ecf8;
    border-radius: 10px;
    color: #1a1a1a;
}

.calendar-table td {
    vertical-align: middle;
}

.cell-center {
    text-align: center;
}

/* Row states */
tr.is-past {
    opacity: .55;
}

tr.is-soon td {
    background: #f0f5ff;
}

/* subtle brand-tinted background */
tr.is-soon:hover td {
    background: #e9f1ff;
}

/* ===== Type button ===== */
.typeset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e7ecf8;
    background: #fff;
    color: #1a1a1a;
    font-weight: 600;
    cursor: pointer;
    min-width: 110px;
}

.typeset.notype {
    color: #7a8ab3;
    font-style: italic;
    font-weight: 500;
}

/* ===== Type modal / popover ===== */
.type-modal {
    position: fixed;
    left: 12px;
    top: 12px;
    z-index: 1100;
    width: clamp(260px, 92vw, 360px);
    max-height: 80vh;
    overflow: auto;
    background: #fff;
    border: 1px solid #e7ecf8;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
    padding: 10px 12px;
    display: none;
}

.type-modal--open {
    display: block;
}

.type-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 6px;
    border-bottom: 1px solid #eef1f7;
    margin-bottom: 8px;
}

.type-modal__body {
    display: grid;
    gap: 8px;
}

.type-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #1a1a1a;
}

.type-option input {
    width: 16px;
    height: 16px;
}

.type-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 22px;
    border-radius: 6px;
    background: #f6f8ff;
    color: #174AA1;
    font-weight: 700;
}

.type-label {
    color: #333;
}

/* Close button inside modal */
.type-modal__close {
    width: 32px;
    height: 32px;
}

/* Attachment button */
.attachement-add {
    border: 1px solid #e7ecf8;
    border-radius: 8px;
    background: #fff;
}

/* Save button disabled state */
#savebtn[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

/* Screen-reader only bucket for hidden diff inputs */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Small screens: slightly reduce header cell size and input min-width */
@media (max-width: 640px) {
    .data-table thead th {
        font-size: 13px;
        padding: 8px 10px;
    }

    .calendar-table input {
        min-width: 200px;
    }

    /* easier to edit when horizontally scrolling */
}