/* ==========================================================================
   Wunschzettel – Theme
   Liegt über dem kompilierten Bootstrap 4 (css/app.css) und braucht keinen Build.
   ========================================================================== */

:root {
    --fir-900: #13342a;
    --fir-700: #1f4d3a;
    --fir-600: #2a6049;
    --fir-100: #e3eee8;
    --berry-600: #b0353a;
    --berry-500: #c4454a;
    --berry-100: #f8e4e2;
    --gold-500: #c99a2e;
    --gold-100: #f7edd3;
    --cream-50: #fdfaf4;
    --cream-100: #f8f1e5;
    --cream-200: #efe4d2;
    --ink-900: #2b2622;
    --ink-600: #6b625a;
    --ink-400: #9a9087;
    --white: #ffffff;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(43, 38, 34, .06), 0 1px 3px rgba(43, 38, 34, .05);
    --shadow: 0 6px 24px -8px rgba(43, 38, 34, .18), 0 2px 6px rgba(43, 38, 34, .05);
    --shadow-lg: 0 18px 40px -16px rgba(19, 52, 42, .35);

    --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

/* Das alte Stylesheet färbt jedes Element fest ein – wieder auf Vererbung stellen. */
* { color: inherit; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink-900);
    background-color: var(--cream-50);
    background-image:
        radial-gradient(circle at 12% -10%, rgba(201, 154, 46, .10), transparent 40%),
        radial-gradient(circle at 100% 0%, rgba(42, 96, 73, .10), transparent 45%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

main.app-main { flex: 1 0 auto; padding: 2rem 0 3.5rem; }

.container { max-width: 960px; padding-left: 16px; padding-right: 16px; }
.container-narrow { max-width: 720px; }
.container-auth { max-width: 480px; }

h1, h2, h3, h4, .display-font {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--fir-900);
}

a { color: var(--fir-600); text-decoration: none; }
a:hover, a:focus { color: var(--berry-600); text-decoration: none; }

::selection { background: var(--gold-100); }

:focus-visible { outline: 3px solid rgba(201, 154, 46, .55); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Kopfzeile
   -------------------------------------------------------------------------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(253, 250, 244, .85);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--cream-200);
}

.app-header .navbar { padding: .75rem 0; }
.app-header .navbar > .container { padding-left: 16px !important; padding-right: 16px !important; }
@media (max-width: 767.98px) {
    .app-header .navbar-collapse { padding: .5rem 0 .25rem; }
    .app-header .navbar-nav .nav-link { padding: .6rem .9rem !important; }
    .app-header .user-chip { margin-top: .35rem; align-self: flex-start; }
    .app-header .navbar-nav { align-items: stretch; }
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--fir-900);
}
.brand:hover { color: var(--fir-900); }

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--berry-500), var(--berry-600));
    box-shadow: 0 4px 12px -4px rgba(176, 53, 58, .6);
}
.brand-mark i { color: #fff; font-size: 1rem; }

.app-header .nav-link {
    font-weight: 600;
    color: var(--ink-600);
    padding: .45rem .9rem !important;
    border-radius: 999px;
}
.app-header .nav-link:hover { color: var(--fir-900); background: var(--cream-100); }

.user-chip {
    display: inline-flex !important;
    align-items: center;
    gap: .55rem;
    background: var(--white);
    border: 1px solid var(--cream-200);
    color: var(--ink-900) !important;
}
.user-chip .avatar {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--fir-100);
    color: var(--fir-700);
    font-size: .8rem;
    font-weight: 800;
}
.user-chip::after { margin-left: .15rem; }

.navbar-toggler {
    border: 1px solid var(--cream-200);
    border-radius: 12px;
    padding: .4rem .6rem;
}

.dropdown-menu {
    border: 1px solid var(--cream-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: .4rem;
}
.dropdown-item { border-radius: 8px; padding: .5rem .8rem; font-weight: 600; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--cream-100); color: var(--berry-600); }
.dropdown-item i { width: 1.1rem; color: var(--ink-400); }

/* --------------------------------------------------------------------------
   Seitenkopf
   -------------------------------------------------------------------------- */
.page-head { margin-bottom: 1.5rem; }
.page-head .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--berry-600);
    margin-bottom: .35rem;
}
.page-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0; }
.page-head p { color: var(--ink-600); margin: .4rem 0 0; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-weight: 700;
    color: var(--ink-600);
    margin-bottom: 1rem;
    padding: .3rem .1rem;
}
.back-link:hover { color: var(--fir-900); }
.back-link i { font-size: .8rem; transition: transform .15s ease; }
.back-link:hover i { transform: translateX(-3px); }

/* --------------------------------------------------------------------------
   Karten / Flächen
   -------------------------------------------------------------------------- */
.surface,
.card {
    background: var(--white);
    border: 1px solid var(--cream-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.surface { padding: 1.5rem; }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--cream-200);
    font-weight: 700;
    padding: 1rem 1.5rem;
}
.card-body { padding: 1.5rem; }

@media (max-width: 575.98px) {
    .surface, .card-body { padding: 1.15rem; }
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 .9rem;
}
.section-title h2 { font-size: 1.15rem; margin: 0; }
.section-title .count {
    font-size: .8rem;
    font-weight: 800;
    color: var(--ink-600);
    background: var(--cream-100);
    border-radius: 999px;
    padding: .15rem .6rem;
}

/* --------------------------------------------------------------------------
   Startseite – Kacheln
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 2rem 1.75rem;
    margin-bottom: 1.75rem;
    color: #fff;
    background:
        radial-gradient(circle at 85% 20%, rgba(201, 154, 46, .35), transparent 35%),
        linear-gradient(135deg, var(--fir-700), var(--fir-900));
    box-shadow: var(--shadow-lg);
}
.hero h1 { color: #fff; font-size: clamp(1.6rem, 4.5vw, 2.4rem); margin: 0 0 .35rem; }
.hero p { color: rgba(255, 255, 255, .82); margin: 0; max-width: 36rem; }
.hero .hero-deco {
    position: absolute;
    right: 1.25rem;
    bottom: -1.25rem;
    font-size: 7rem;
    color: rgba(255, 255, 255, .08);
    pointer-events: none;
}
.hero .deadline {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
    padding: .4rem .85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
}
.hero .deadline i { color: var(--gold-100); }

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.25rem;
    background: var(--white);
    border: 1px solid var(--cream-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: var(--ink-900);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tile:hover, .tile:focus {
    color: var(--ink-900);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--gold-100);
}
.tile-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 1.3rem;
}
.tile-icon i { color: inherit; }
.tile-icon.fir   { background: var(--fir-100);   color: var(--fir-700); }
.tile-icon.berry { background: var(--berry-100); color: var(--berry-600); }
.tile-icon.gold  { background: var(--gold-100);  color: #8a6512; }
.tile-icon.ink   { background: var(--cream-100); color: var(--ink-600); }
.tile-text { flex: 1 1 auto; min-width: 0; }
.tile-text strong { display: block; font-size: 1.05rem; font-weight: 800; color: var(--fir-900); }
.tile-text span { display: block; font-size: .9rem; color: var(--ink-600); }
.tile-arrow { color: var(--ink-400); transition: transform .15s ease, color .15s ease; }
.tile:hover .tile-arrow { transform: translateX(3px); color: var(--berry-600); }

/* --------------------------------------------------------------------------
   Listen (Wünsche, Personen, Archiv)
   -------------------------------------------------------------------------- */
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list > li + li { border-top: 1px solid var(--cream-100); }

.item-row {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .85rem .25rem;
    min-height: 56px;
}
.item-row .item-main { flex: 1 1 auto; min-width: 0; }
.item-row .item-title {
    display: block;
    font-weight: 700;
    color: var(--ink-900);
    overflow-wrap: anywhere;
}
.item-row a.item-title:hover { color: var(--berry-600); }
.item-row .item-meta {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    color: var(--ink-400);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.item-row .item-meta i { font-size: .72rem; }
.item-row .item-actions { display: flex; gap: .35rem; flex: 0 0 auto; }

a.item-row { color: inherit; border-radius: var(--radius-sm); margin: 0 -.5rem; padding-left: .75rem; padding-right: .75rem; }
a.item-row:hover { background: var(--cream-50); color: inherit; }

.item-bullet {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--berry-100);
    color: var(--berry-600);
    font-size: .85rem;
}
.item-bullet i { color: inherit; }
.item-bullet.muted { background: var(--cream-100); color: var(--ink-400); }

.avatar-lg {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--fir-100);
    color: var(--fir-700);
    font-weight: 800;
}

.item-row.is-done .item-title { color: var(--ink-400); text-decoration: line-through; }
.item-row.is-done .item-bullet { background: var(--fir-100); color: var(--fir-700); }
.item-row.is-draft .item-title { color: var(--ink-600); }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--cream-200);
    background: var(--white);
    color: var(--ink-600);
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn i { color: inherit; }
.icon-btn:hover { background: var(--cream-100); color: var(--fir-900); }
.icon-btn.success:hover { background: var(--fir-100); border-color: var(--fir-100); color: var(--fir-700); }
.icon-btn.danger:hover { background: var(--berry-100); border-color: var(--berry-100); color: var(--berry-600); }

.check-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .85rem;
    border-radius: 999px;
    border: 1px solid var(--cream-200);
    background: var(--white);
    color: var(--ink-600);
    font-weight: 700;
    font-size: .88rem;
    white-space: nowrap;
}
.check-btn i { color: inherit; }
.check-btn:hover { border-color: var(--fir-600); color: var(--fir-700); background: var(--fir-100); }
.check-btn.undo:hover { border-color: var(--berry-500); color: var(--berry-600); background: var(--berry-100); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 800;
    background: var(--cream-100);
    color: var(--ink-600);
    white-space: nowrap;
}
.pill.fir { background: var(--fir-100); color: var(--fir-700); }
.pill.gold { background: var(--gold-100); color: #8a6512; }
.pill i { color: inherit; }

/* Leerzustand */
.empty-state {
    text-align: center;
    padding: 2.25rem 1rem;
    color: var(--ink-600);
}
.empty-state .empty-icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--cream-100);
    color: var(--gold-500);
    font-size: 1.6rem;
    margin-bottom: .9rem;
}
.empty-state .empty-icon i { color: inherit; }
.empty-state strong { display: block; color: var(--fir-900); font-size: 1.05rem; margin-bottom: .25rem; }

/* Hinweis */
.notice {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .9rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--gold-100);
    color: #6d5110;
    font-weight: 600;
}
.notice i { color: inherit; margin-top: .2rem; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    font-weight: 700;
    border-radius: 12px;
    padding: .65rem 1.25rem;
    border-width: 1px;
    transition: transform .1s ease, box-shadow .15s ease, background .15s ease;
}
.btn i { color: inherit; }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: .8rem 1.5rem; font-size: 1.05rem; }

.btn-primary,
.btn-success {
    color: #fff;
    background: var(--fir-700);
    border-color: var(--fir-700);
    box-shadow: 0 6px 16px -8px rgba(31, 77, 58, .8);
}
.btn-primary:hover, .btn-primary:focus,
.btn-success:hover, .btn-success:focus,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-success:not(:disabled):not(.disabled):active {
    color: #fff;
    background: var(--fir-900);
    border-color: var(--fir-900);
}

.btn-accent {
    color: #fff;
    background: var(--berry-600);
    border-color: var(--berry-600);
    box-shadow: 0 6px 16px -8px rgba(176, 53, 58, .8);
}
.btn-accent:hover, .btn-accent:focus { color: #fff; background: #962c31; border-color: #962c31; }

.btn-ghost {
    color: var(--ink-600);
    background: var(--white);
    border-color: var(--cream-200);
}
.btn-ghost:hover { color: var(--fir-900); background: var(--cream-100); }

.btn-link { color: var(--fir-600); font-weight: 700; }
.btn-link:hover { color: var(--berry-600); text-decoration: none; }

.btn-block + .btn-block { margin-top: .5rem; }

/* --------------------------------------------------------------------------
   Formulare
   -------------------------------------------------------------------------- */
label, .form-label {
    font-weight: 700;
    font-size: .9rem;
    color: var(--ink-900);
    margin-bottom: .35rem;
}

.form-control {
    height: auto;
    padding: .7rem .95rem;
    font-size: 1rem;
    border: 1px solid var(--cream-200);
    border-radius: 12px;
    background: var(--cream-50);
    color: var(--ink-900);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.form-control::placeholder { color: var(--ink-400); }
.form-control:focus {
    background: var(--white);
    border-color: var(--fir-600);
    box-shadow: 0 0 0 4px rgba(42, 96, 73, .14);
}
.form-control.is-invalid { border-color: var(--berry-500); }
.invalid-feedback { color: var(--berry-600); font-weight: 600; }
.form-hint { font-size: .85rem; color: var(--ink-600); margin-top: .35rem; }

.input-icon { position: relative; }
.input-icon > i {
    position: absolute;
    left: .95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-400);
    pointer-events: none;
}
.input-icon > .form-control { padding-left: 2.6rem; }

/* Umschalter für "vormerken" */
.toggle {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: .9rem 1rem;
    border: 1px solid var(--cream-200);
    border-radius: 12px;
    background: var(--cream-50);
    cursor: pointer;
    font-weight: 600;
    margin: 0;
}
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .switch {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
    margin-top: .1rem;
    border-radius: 999px;
    background: var(--cream-200);
    transition: background .15s ease;
}
.toggle .switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease;
}
.toggle input:checked + .switch { background: var(--fir-600); }
.toggle input:checked + .switch::after { transform: translateX(18px); }
.toggle input:focus-visible + .switch { outline: 3px solid rgba(201, 154, 46, .55); outline-offset: 2px; }
.toggle small { display: block; font-weight: 500; color: var(--ink-600); }

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1.5rem;
}
@media (max-width: 575.98px) {
    .form-actions .btn { flex: 1 1 100%; }
}

/* --------------------------------------------------------------------------
   Anmeldung / Registrierung
   -------------------------------------------------------------------------- */
.auth-card { padding: 2rem; }
@media (max-width: 575.98px) { .auth-card { padding: 1.35rem; } }
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-head .brand-mark { width: 56px; height: 56px; border-radius: 18px; margin-bottom: 1rem; }
.auth-head .brand-mark i { font-size: 1.4rem; }
.auth-head h1 { font-size: 1.7rem; margin: 0 0 .25rem; }
.auth-head p { color: var(--ink-600); margin: 0; }
.auth-foot { text-align: center; margin-top: 1.25rem; color: var(--ink-600); font-size: .95rem; }
.auth-foot a { font-weight: 700; }

.alert { border: 0; border-radius: 12px; font-weight: 600; }
.alert-success { background: var(--fir-100); color: var(--fir-900); }
.alert-warning { background: var(--gold-100); color: #6d5110; }
.alert-danger  { background: var(--berry-100); color: #7d2328; }

/* --------------------------------------------------------------------------
   Tabellen (Wichteln)
   -------------------------------------------------------------------------- */
.table { color: var(--ink-900); margin: 0; }
.table td, .table th { border-color: var(--cream-100); padding: .85rem .5rem; vertical-align: middle; }
.table thead th { border-bottom: 1px solid var(--cream-200); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-600); }

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