/* ── Design-Tokens: Hell ────────────────────────────── */

:root {
    --bg:       #f7f6f4;
    --surface:  #ffffff;
    --fg:       #1a1a1a;
    --muted:    #8a8a8a;
    --muted2:   #c8c8c8;
    --border:   #e8e6e2;
    --sans:     'Outfit', system-ui, -apple-system, sans-serif;

    --shadow-sm:  0 2px 10px rgba(0,0,0,0.06);
    --shadow-md:  0 8px 30px rgba(0,0,0,0.10);
    --ease:       cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Login */
    --login-bg:          #f7f6f4;
    --login-fg:          #1a1a1a;
    --login-tagline:     rgba(0,0,0,0.35);
    --login-divider:     rgba(0,0,0,0.10);
    --login-input-bd:    rgba(0,0,0,0.15);
    --login-input-foc:   rgba(0,0,0,0.65);
    --login-placeholder: rgba(0,0,0,0.22);
    --login-notice-bg:   rgba(0,0,0,0.04);
    --login-notice-bd:   rgba(0,0,0,0.10);
    --login-notice-col:  rgba(0,0,0,0.42);
    --login-dot:         #16a34a;
    --login-dot-closed:  #dc2626;
    --login-btn-bg:      #1a1a1a;
    --login-btn-fg:      #ffffff;
    --login-error:       #b91c1c;
}

/* ── Design-Tokens: Dunkel ──────────────────────────── */

@media (prefers-color-scheme: dark) {
    :root {
        --bg:       #111111;
        --surface:  #1c1c1c;
        --fg:       #edebe8;
        --muted:    #777777;
        --muted2:   #383838;
        --border:   #2c2c2c;

        --shadow-sm:  none;
        --shadow-md:  0 8px 28px rgba(0,0,0,0.5);

        /* Login */
        --login-bg:          #0c0c0c;
        --login-fg:          #ffffff;
        --login-tagline:     rgba(255,255,255,0.30);
        --login-divider:     rgba(255,255,255,0.12);
        --login-input-bd:    rgba(255,255,255,0.12);
        --login-input-foc:   rgba(255,255,255,0.60);
        --login-placeholder: rgba(255,255,255,0.20);
        --login-notice-bg:   rgba(255,255,255,0.04);
        --login-notice-bd:   rgba(255,255,255,0.08);
        --login-notice-col:  rgba(255,255,255,0.38);
        --login-dot:         #4ade80;
        --login-dot-closed:  #f87171;
        --login-btn-bg:      #ffffff;
        --login-btn-fg:      #0c0c0c;
        --login-error:       #f87171;
    }
}

/* ── Reset ───────────────────────────────────────────── */

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

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.55;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

/* ── Login-Seite ─────────────────────────────────────── */

.login-wrap {
    min-height: 100svh;
    background: var(--login-bg);
    color: var(--login-fg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    gap: 2.25rem;
}

.login-hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.login-title {
    font-size: clamp(1.9rem, 6vw, 3rem);
    font-weight: 300;
    letter-spacing: 0.06em;
    color: var(--login-fg);
    line-height: 1.1;
}

.login-tagline {
    font-size: 0.72rem;
    color: var(--login-tagline);
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.login-divider {
    width: 36px;
    height: 1px;
    background: var(--login-divider);
}

.login-notice {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.72rem;
    color: var(--login-notice-col);
    letter-spacing: 0.04em;
    background: var(--login-notice-bg);
    border: 1px solid var(--login-notice-bd);
    padding: 0.55rem 1rem;
    max-width: 90vw;
}

.notice-dot {
    width: 6px;
    height: 6px;
    min-width: 6px;
    background: var(--login-dot);
    border-radius: 50%;
    animation: dot-pulse 2.2s ease-in-out infinite;
}

.notice-dot.closed {
    background: var(--login-dot-closed);
}

.login-notice-sub {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.66rem;
    opacity: 0.78;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.25; }
}

.login-form {
    display: flex;
    flex-direction: column;
    width: min(280px, 88vw);
}

.login-form input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--login-input-bd);
    padding: 0.9rem 0;
    color: var(--login-fg);
    font-size: 0.88rem;
    font-family: var(--sans);
    font-weight: 300;
    outline: none;
    transition: border-color 0.2s;
    letter-spacing: 0.03em;
    width: 100%;
}

.login-form input + input  { margin-top: 0.15rem; }
.login-form input:focus    { border-bottom-color: var(--login-input-foc); }

.login-form input::placeholder {
    color: var(--login-placeholder);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    font-weight: 400;
}

.login-form button {
    margin-top: 2.25rem;
    background: var(--login-btn-bg);
    color: var(--login-btn-fg);
    border: none;
    padding: 0.9rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-family: var(--sans);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 500;
    transition: opacity 0.2s;
    min-height: 48px;
}

.login-form button:hover  { opacity: 0.82; }
.login-form button:active { opacity: 0.65; }

.login-wrap .error {
    color: var(--login-error);
    font-size: 0.78rem;
    text-align: center;
    letter-spacing: 0.03em;
}

.login-success,
.login-secondary {
    font-size: 0.78rem;
    text-align: center;
    letter-spacing: 0.03em;
}

.login-success { color: var(--login-dot); }

.login-secondary a {
    color: var(--login-muted);
    text-decoration: none;
    border-bottom: 1px solid var(--login-input-bd);
}

.login-secondary a:hover { color: var(--login-fg); border-color: var(--login-fg); }

/* ── Header ─────────────────────────────────────────── */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 2.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

header h1 {
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-form {
    margin: 0;
    display: flex;
    flex-shrink: 0;
}

.logout {
    font-size: 0.76rem;
    color: var(--muted);
    letter-spacing: 0.05em;
    padding: 0.5rem 0;
    flex-shrink: 0;
    transition: color 0.15s;
    /* Button als Link darstellen */
    background: none;
    border: 0;
    font-family: inherit;
    text-transform: inherit;
    text-align: center;
    cursor: pointer;
}

.logout:hover { color: var(--fg); }

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-link {
    font-size: 0.76rem;
    color: var(--muted);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color 0.15s;
}

.header-link:hover,
.header-link.active-link { color: var(--fg); }

@media (max-width: 640px) {
    header {
        gap: 1rem;
        padding: 0.85rem 1rem;
    }

    header h1 {
        max-width: 52vw;
        font-size: 0.78rem;
        letter-spacing: 0.08em;
    }

    .header-right {
        gap: 0.75rem;
        flex-shrink: 0;
    }

    .header-link,
    .logout {
        font-size: 0.72rem;
        letter-spacing: 0.03em;
    }

    .logout {
        padding-left: 0;
    }
}

/* ── Main ───────────────────────────────────────────── */

main {
    padding: 2.5rem 2.5rem;
    max-width: 1500px;
    margin: 0 auto;
}

/* Platz für die fixe Zeitleiste lassen */
@media (min-width: 641px) {
    main { padding-right: 118px; }
}

@media (max-width: 640px) {
    main {
        padding: 1.25rem 1rem 2rem;
    }
}

.empty {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 3rem;
    text-align: center;
}

.empty code {
    font-family: monospace;
    background: var(--border);
    padding: 0.1em 0.4em;
    font-size: 0.85em;
}

/* ── Jahres-Navigation ──────────────────────────────── */

.album-search {
    margin-bottom: 1.25rem;
}

.album-search input {
    width: min(360px, 100%);
    min-height: 44px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--fg);
    font-family: var(--sans);
    font-size: 0.88rem;
    padding: 0.7rem 0.85rem;
    outline: none;
    transition: border-color 0.15s;
}

.album-search input:focus {
    border-color: var(--fg);
}

.album-search input::placeholder {
    color: var(--muted);
}

.search-empty[hidden] {
    display: none;
}

.year-nav {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

.year-nav::-webkit-scrollbar { display: none; }

.year-link {
    flex-shrink: 0;
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.07em;
    color: var(--muted);
    text-decoration: none;
    padding: 0.7rem 1.1rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.2s;
    white-space: nowrap;
}

.year-link:hover  { color: var(--fg); }

.year-link.active {
    color: var(--fg);
    font-weight: 500;
    border-bottom-color: var(--fg);
}

/* ── Masonry-Albumgitter ────────────────────────────── */

.album-grid {
    columns: 220px;
    column-gap: 1.5rem;
}

.album-card {
    display: block;
    break-inside: avoid;
    margin-bottom: 1.75rem;
    text-decoration: none;
    color: var(--fg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity    0.5s  ease,
        transform  0.35s var(--ease),
        box-shadow 0.3s  var(--ease);
}

@media (prefers-color-scheme: dark) {
    .album-card { border: 1px solid var(--border); }
}

.album-card.visible      { opacity: 1; transform: translateY(0); }
.album-card.year-hidden  { display: none; }
.album-card.search-hidden { display: none; }

@media (hover: hover) {
    .album-card:hover {
        transform: translateY(-4px) scale(1.015);
        box-shadow: var(--shadow-md);
    }
    .album-card:hover .album-cover { transform: scale(1.06); }
}

.album-cover-wrap {
    overflow: hidden;
    aspect-ratio: 3 / 2;
    background: var(--border);
}

.album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s var(--ease);
}

.album-cover-placeholder {
    width: 100%;
    height: 100%;
    background: var(--border);
}

.album-info { padding: 0.8rem 0.9rem 0.9rem; }

.album-name {
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.35;
}

.album-meta {
    font-size: 0.74rem;
    color: var(--muted);
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    font-weight: 300;
}

.sep { color: var(--muted2); }

.album-location { color: var(--muted); }

/* ── Zeitleiste (fixes Overlay, rechter Rand) ───────── */

.timeline {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;

    width: 88px;
    max-height: 72svh;
    overflow-y: auto;
    scrollbar-width: none;

    padding: 1.25rem 0.9rem 1.25rem 1rem;
    background: var(--surface);
    border-left: 1px solid var(--border);
    border-radius: 8px 0 0 8px;
    box-shadow: -3px 0 16px rgba(0,0,0,0.06);
}

@media (prefers-color-scheme: dark) {
    .timeline { box-shadow: -3px 0 16px rgba(0,0,0,0.35); }
}

.timeline::-webkit-scrollbar { display: none; }

.timeline-inner {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.tl-year-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tl-year-label {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg);
    padding: 0 0 0.4rem 1rem;
    opacity: 0.5;
}

.tl-month {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--muted);
    text-decoration: none;
    padding: 0.22rem 0;
    min-height: 30px;
    letter-spacing: 0.02em;
    transition: color 0.15s;
    position: relative;
}

/* Dot-Indikator */
.tl-month::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    border: 1.5px solid var(--muted2);
    background: transparent;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.tl-month:hover              { color: var(--fg); }
.tl-month:hover::before      { border-color: var(--fg); }

.tl-month.active             { color: var(--fg); font-weight: 500; }
.tl-month.active::before {
    background: var(--fg);
    border-color: var(--fg);
    transform: scale(1.4);
}

/* Zeitleiste auf kleinen Screens als kompakte Monatsleiste */
@media (max-width: 640px) {
    .timeline {
        position: relative;
        transform: none;
        width: auto;
        max-height: none;
        margin: -1.5rem 0 1.35rem;
        padding: 1.85rem 0 0.8rem;
        overflow-x: auto;
        overflow-y: hidden;
        background: var(--surface);
        border-left: none;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        box-shadow: none;
    }

    .timeline::before {
        content: 'Monate';
        position: absolute;
        top: 0.45rem;
        left: 0;
        font-size: 0.6rem;
        font-weight: 600;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--muted);
    }

    .timeline-inner {
        flex-direction: row;
        gap: 1.15rem;
        width: max-content;
        min-width: 100%;
        padding-right: 0.25rem;
    }

    .tl-year-group {
        flex-direction: row;
        align-items: center;
        gap: 0.35rem;
    }

    .tl-year-label {
        padding: 0 0.45rem 0 0;
        font-size: 0.58rem;
        white-space: nowrap;
        opacity: 0.7;
    }

    .tl-month {
        min-height: 36px;
        padding: 0 0.7rem;
        white-space: nowrap;
        border: 1px solid var(--border);
        background: var(--bg);
        font-weight: 400;
    }

    .tl-month.active {
        color: var(--surface);
        background: var(--fg);
        border-color: var(--fg);
    }

    .tl-month.active::before {
        background: var(--surface);
        border-color: var(--surface);
    }
}

/* ── Album-Ansicht ──────────────────────────────────── */

.back-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 1.25rem;
    font-size: 0.78rem;
    color: var(--muted);
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.15s;
}

.back-link:hover { color: var(--fg); }

.album-heading-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    max-width: 900px;
    margin-bottom: 0.35rem;
}

.album-title {
    font-size: clamp(1.4rem, 4vw, 1.9rem);
    font-weight: 300;
    margin: 0;
    letter-spacing: 0.01em;
    line-height: 1.2;
    min-width: 0;
}

.album-subtitle {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 2rem;
    letter-spacing: 0.04em;
    font-weight: 300;
}

.album-description {
    max-width: 680px;
    margin: -0.8rem 0 2rem;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.65;
    font-weight: 300;
}

.album-edit-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    font-family: var(--sans);
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0;
    border: 1px solid var(--border);
}

.album-edit-trigger:hover {
    color: var(--fg);
    border-color: var(--fg);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 3px;
}

.photo-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    cursor: pointer;
    background: var(--border);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.photo-thumb.visible      { opacity: 1; }

@media (hover: hover) {
    .photo-thumb:hover    { opacity: 0.78; }
}

/* ── Lightbox ───────────────────────────────────────── */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 8, 0.97);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox-img {
    max-width: 90vw;
    max-height: 85svh;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
    display: block;
}

/* Close-Button liegt ganz oben (z-index verhindert Überdeckung durch Prev/Next) */
.lightbox-close {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 2;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 300;
    font-family: var(--sans);
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.lightbox-close:hover { color: #fff; }

.lightbox-prev,
.lightbox-next {
    position: fixed;
    z-index: 1;
    top: 56px;   /* unterhalb des Close-Buttons */
    bottom: 0;
    width: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    font-weight: 300;
    font-family: var(--sans);
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }

.lightbox-prev:hover,
.lightbox-next:hover { color: #fff; }

.lightbox-bottom {
    position: fixed;
    bottom: 1.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
    pointer-events: none;
    max-width: 90vw;
}

.lightbox-counter {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.16em;
}

.lightbox-exif {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.05em;
    font-weight: 300;
    line-height: 1.5;
}

@media (hover: none), (pointer: coarse) {
    .lightbox-img {
        max-width: 100vw;
        max-height: 78svh;
    }

    .lightbox-close {
        top: env(safe-area-inset-top);
        right: env(safe-area-inset-right);
        width: 64px;
        height: 64px;
        color: rgba(255,255,255,0.75);
    }

    .lightbox-prev,
    .lightbox-next {
        top: 64px;
        bottom: max(76px, env(safe-area-inset-bottom));
        width: 28vw;
        max-width: 120px;
        color: rgba(255,255,255,0.55);
    }

    .lightbox-prev {
        justify-content: flex-start;
        padding-left: max(1rem, env(safe-area-inset-left));
    }

    .lightbox-next {
        justify-content: flex-end;
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .lightbox-bottom {
        bottom: max(1.25rem, env(safe-area-inset-bottom));
        max-width: calc(100vw - 2rem);
    }
}

/* ── Flash-Meldungen ────────────────────────────────── */

.flash {
    padding: 0.75rem 1rem;
    font-size: 0.84rem;
    margin-bottom: 1.75rem;
    border-left: 3px solid;
    letter-spacing: 0.02em;
}

.flash-success {
    background: rgba(34, 197, 94, 0.08);
    color: #166534;
    border-color: #22c55e;
}

.flash-error {
    background: rgba(239, 68, 68, 0.08);
    color: #991b1b;
    border-color: #ef4444;
}

@media (prefers-color-scheme: dark) {
    .flash-success { background: rgba(34,197,94,0.1);  color: #86efac; }
    .flash-error   { background: rgba(239,68,68,0.1);  color: #fca5a5; }
}

/* ── Admin-Seite ─────────────────────────────────────── */

.admin-main { max-width: 1000px; }

.admin-heading {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
    letter-spacing: 0.01em;
}

.admin-subheading {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.1rem;
}

.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.registration-admin-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.registration-admin-status {
    margin: 0 0 0.35rem;
    font-size: 0.88rem;
    font-weight: 500;
}

@media (max-width: 640px) {
    .registration-admin-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Benutzertabelle */
.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.user-table th {
    text-align: left;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
}

.user-table th:first-child { padding-left: 0; }

.user-table td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.user-table td:first-child  { padding-left: 0; }
.user-table tbody tr:last-child td { border-bottom: none; }

.user-inactive td { opacity: 0.45; }

.td-name    { font-weight: 500; }
.td-date    { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.td-actions { white-space: nowrap; }

.badge-me {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 0.1em 0.45em;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.role-label {
    font-size: 0.82rem;
    color: var(--muted);
}

.role-select {
    font-family: var(--sans);
    font-size: 0.82rem;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    outline: none;
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.dot-active   { background: #22c55e; }
.dot-inactive { background: var(--muted2); }

/* Aktions-Schaltflächen */
.inline-form { display: inline; }

.btn-ghost,
.btn-primary,
.btn-danger {
    font-family: var(--sans);
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    border: none;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    transition: opacity 0.15s;
    background: transparent;
    text-decoration: none;
}

.btn-ghost {
    color: var(--muted);
    border: 1px solid var(--border);
    background: transparent;
}

.btn-ghost:hover  { color: var(--fg); border-color: var(--fg); }

.btn-primary {
    background: var(--fg);
    color: var(--bg);
}

.btn-primary:hover { opacity: 0.75; }

.btn-danger {
    color: #ef4444;
    border: 1px solid transparent;
}

.btn-danger:hover { border-color: #ef4444; }

/* Passwort-Details-Element */
.action-details {
    display: inline-block;
    margin-right: 0.35rem;
}

.action-details > summary {
    list-style: none;
    cursor: pointer;
}

.action-details > summary::-webkit-details-marker { display: none; }

.passwd-panel {
    position: absolute;
    z-index: 50;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.85rem;
    margin-top: 0.4rem;
    box-shadow: var(--shadow-md);
    min-width: 260px;
}

.passwd-panel form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.passwd-panel input[type="password"] {
    flex: 1;
    font-family: var(--sans);
    font-size: 0.82rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    padding: 0.4rem 0.6rem;
    outline: none;
    min-width: 0;
}

.passwd-panel input:focus { border-color: var(--fg); }

/* Neuer Benutzer – Formular */
.add-user-form .form-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

.add-user-form input,
.add-user-form select {
    font-family: var(--sans);
    font-size: 0.85rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    padding: 0.55rem 0.75rem;
    outline: none;
    transition: border-color 0.15s;
}

.add-user-form input:focus,
.add-user-form select:focus { border-color: var(--fg); }

.add-user-form input[name="username"] { width: 160px; }
.add-user-form input[name="password"] { width: 200px; }

.admin-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.album-meta-item {
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 0;
}

.album-meta-item:first-child { padding-top: 0; }
.album-meta-item:last-child  { border-bottom: none; padding-bottom: 0; }

.album-meta-item > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    list-style: none;
    cursor: pointer;
}

.album-meta-item > summary::-webkit-details-marker { display: none; }

.album-meta-item strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
}

.album-meta-item small {
    display: block;
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.album-meta-form {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
    max-width: 620px;
}

.album-meta-form label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.album-meta-form input,
.album-meta-form textarea {
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    padding: 0.55rem 0.75rem;
    outline: none;
}

.album-meta-form textarea {
    resize: vertical;
    line-height: 1.5;
}

.album-meta-form input:focus,
.album-meta-form textarea:focus { border-color: var(--fg); }

.album-meta-form .btn-primary {
    justify-self: start;
}

.album-edit-modal[hidden] {
    display: none;
}

.album-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 900;
}

.album-edit-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 8, 0.58);
}

.album-edit-dialog {
    position: relative;
    z-index: 1;
    width: min(620px, calc(100vw - 2rem));
    max-height: calc(100svh - 2rem);
    overflow: auto;
    margin: 1rem auto;
    padding: 1.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.album-edit-dialog h3 {
    margin: 0 2.5rem 1.2rem 0;
    font-size: 1.05rem;
    font-weight: 400;
}

.album-edit-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 1.2rem;
    line-height: 1;
}

.album-edit-close:hover {
    color: var(--fg);
    border-color: var(--fg);
}

.album-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.2rem;
}

/* ── Responsiv ──────────────────────────────────────── */

@media (max-width: 1024px) {
    .album-grid { columns: 200px; }
}

@media (max-width: 768px) {
    header        { padding: 1rem 1.25rem; }
    main          { padding: 1.5rem 1rem; }
    .album-grid   { columns: 170px; column-gap: 1rem; }
    .album-card   { margin-bottom: 1rem; }
    .photo-grid   { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 2px; }
}

@media (max-width: 480px) {
    header h1     { font-size: 0.82rem; }
    .album-grid   { columns: 2; column-gap: 0.75rem; }
    .album-card   { margin-bottom: 0.75rem; }
    .album-info   { padding: 0.6rem 0.7rem 0.7rem; }
    .album-name   { font-size: 0.82rem; }
    .photo-grid   { grid-template-columns: repeat(3, 1fr); gap: 2px; }
    .lightbox-prev,
    .lightbox-next { width: 52px; font-size: 2rem; }
}
