/* ==========================================================================
   Gemeinschaftshaus – helles, modernes Kachel-Design
   ========================================================================== */

:root {
    --app-bg: #f2f5f9;
    --app-surface: #ffffff;
    --app-accent: #0d9488;
    --app-accent-soft: #ccfbf1;
    --app-accent-dark: #0f766e;
    --app-ink: #1e293b;
    --app-muted: #64748b;
    --app-border: #e2e8f0;
    --app-radius: 1rem;
    --app-shadow: 0 1px 2px rgba(30, 41, 59, .05), 0 4px 16px rgba(30, 41, 59, .06);
}

body {
    background: var(--app-bg);
    color: var(--app-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    padding-bottom: 5.5rem; /* Platz für mobile Bottom-Nav */
}

@media (min-width: 768px) {
    body { padding-bottom: 2rem; }
}

.app-main { padding-top: 1.25rem; }

/* --- Navbar ------------------------------------------------------------- */

.app-navbar {
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 1px 3px rgba(30, 41, 59, .04);
}

.app-navbar .navbar-brand { color: var(--app-ink); }

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .75rem;
    background: linear-gradient(135deg, var(--app-accent), #14b8a6);
    color: #fff;
    font-size: 1rem;
}

.app-navbar .nav-link {
    color: var(--app-muted);
    border-radius: .65rem;
    font-weight: 500;
}

.app-navbar .nav-link:hover { color: var(--app-accent-dark); background: #f1f5f9; }

.app-navbar .nav-link.active {
    color: var(--app-accent-dark);
    background: var(--app-accent-soft);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--app-border);
    border-radius: 2rem;
    background: var(--app-surface);
    padding: .25rem .75rem .25rem .25rem;
    font-weight: 500;
    color: var(--app-ink);
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--app-accent);
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
}

/* --- Mobile Bottom-Nav --------------------------------------------------- */

.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    background: var(--app-surface);
    border-top: 1px solid var(--app-border);
    box-shadow: 0 -2px 12px rgba(30, 41, 59, .07);
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    padding: .55rem 0 .5rem;
    font-size: .68rem;
    text-decoration: none;
    color: var(--app-muted);
}

.mobile-nav a i { font-size: 1.15rem; }

.mobile-nav a.active { color: var(--app-accent-dark); }

.mobile-nav a.active i {
    background: var(--app-accent-soft);
    border-radius: .8rem;
    padding: .2rem .8rem;
    margin: -.2rem 0;
}

/* --- Kacheln & Karten ----------------------------------------------------- */

.card {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--app-border);
    font-weight: 600;
}

.tile {
    display: block;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    padding: 1.1rem 1.2rem;
    text-decoration: none;
    color: var(--app-ink);
    height: 100%;
    transition: transform .12s ease, box-shadow .12s ease;
}

.tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(30, 41, 59, .07), 0 10px 28px rgba(30, 41, 59, .1);
    color: var(--app-ink);
}

.tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: .9rem;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: .65rem;
}

.tile .tile-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.tile .tile-label {
    color: var(--app-muted);
    font-size: .85rem;
    font-weight: 500;
}

.bg-tile-teal   { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.bg-tile-blue   { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.bg-tile-amber  { background: linear-gradient(135deg, #d97706, #fbbf24); }
.bg-tile-rose   { background: linear-gradient(135deg, #e11d48, #fb7185); }
.bg-tile-violet { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.bg-tile-slate  { background: linear-gradient(135deg, #475569, #94a3b8); }

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1.5rem 0 .75rem;
}

/* --- Kalender ------------------------------------------------------------- */

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-head {
    text-align: center;
    font-size: .75rem;
    font-weight: 600;
    color: var(--app-muted);
    padding: .3rem 0;
}

.cal-day {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: .6rem;
    min-height: 4.6rem;
    padding: .3rem .35rem;
    position: relative;
    cursor: pointer;
    transition: border-color .1s ease;
    overflow: hidden;
}

.cal-day:hover { border-color: var(--app-accent); }

.cal-day.cal-out { background: transparent; border-color: transparent; cursor: default; }

.cal-day.cal-today { border-color: var(--app-accent); border-width: 2px; }

.cal-day .cal-num {
    font-size: .78rem;
    font-weight: 600;
    color: var(--app-muted);
}

.cal-day.cal-today .cal-num {
    color: #fff;
    background: var(--app-accent);
    border-radius: .5rem;
    padding: 0 .35rem;
    display: inline-block;
}

.cal-bar {
    height: 6px;
    border-radius: 3px;
    margin-top: 3px;
}

.cal-bar.cal-bar-pending { opacity: .45; }

@media (max-width: 575.98px) {
    .cal-day { min-height: 3.4rem; padding: .2rem .25rem; }
    .cal-bar { height: 5px; margin-top: 2px; }
}

.room-dot {
    display: inline-block;
    width: .7rem;
    height: .7rem;
    border-radius: 50%;
    margin-right: .3rem;
}

/* --- Anwesenheit ----------------------------------------------------------- */

.presence-day {
    display: flex;
    gap: .75rem;
    padding: .55rem .25rem;
    border-bottom: 1px solid var(--app-border);
    align-items: flex-start;
}

.presence-day:last-child { border-bottom: 0; }

.presence-date {
    min-width: 4.6rem;
    text-align: center;
    line-height: 1.15;
}

.presence-date .dow { font-size: .7rem; color: var(--app-muted); font-weight: 600; text-transform: uppercase; }
.presence-date .num { font-size: 1.05rem; font-weight: 700; }

.presence-day.is-today {
    background: var(--app-accent-soft);
    border-radius: .6rem;
    border-bottom-color: transparent;
}

.person-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: #f1f5f9;
    border-radius: 2rem;
    padding: .15rem .6rem .15rem .3rem;
    font-size: .82rem;
    font-weight: 500;
    margin: .12rem .2rem .12rem 0;
}

.person-chip .avatar { width: 1.4rem; height: 1.4rem; font-size: .65rem; }

/* --- Listen / Aufgaben ------------------------------------------------------ */

.list-tile {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: .8rem;
    padding: .8rem 1rem;
    margin-bottom: .6rem;
    box-shadow: 0 1px 2px rgba(30, 41, 59, .04);
}

.task-done { opacity: .55; }
.task-done .task-title { text-decoration: line-through; }

.badge-soft {
    background: #f1f5f9;
    color: var(--app-muted);
    font-weight: 500;
}

.due-overdue { color: #dc2626; font-weight: 600; }

/* --- Formulare / Buttons ----------------------------------------------------- */

.btn-accent {
    background: var(--app-accent);
    border-color: var(--app-accent);
    color: #fff;
    font-weight: 500;
}

.btn-accent:hover, .btn-accent:focus {
    background: var(--app-accent-dark);
    border-color: var(--app-accent-dark);
    color: #fff;
}

.form-control:focus, .form-select:focus {
    border-color: var(--app-accent);
    box-shadow: 0 0 0 .2rem rgba(13, 148, 136, .15);
}

/* --- Login ------------------------------------------------------------------- */

.login-wrap {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 26rem;
    background: var(--app-surface);
    border-radius: 1.25rem;
    box-shadow: var(--app-shadow);
    padding: 2.25rem 2rem;
}

.login-logo {
    width: 4rem;
    height: 4rem;
    border-radius: 1.2rem;
    background: linear-gradient(135deg, var(--app-accent), #14b8a6);
    color: #fff;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
