/* Dashboard Layout */
.dashboard-section {
    padding: 6rem 0 4rem;
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-welcome h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Role Badges */
.dashboard-role {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #6c757d;
}

.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background: #1a1a2e;
    color: white;
}

.role-member {
    background: #4a5568;
    color: white;
}

.role-sub {
    background: #718096;
    color: white;
}

/* Admin Action Buttons — Kachel-Layout */
/* ── Dashboard-Schnellzugriff: einheitliches Raster ──────────────
   Alle freigegebenen Buttons sind gleich große Kacheln. Die Spaltenzahl
   richtet sich nach data-count (1=breit, 2, 3, 4=2x2, …), damit es bei
   jeder Anzahl symmetrisch aussieht. */
/* ===== Dashboard-Schnellzugriff: Hero-Reihe (Featured) + skaliertes Kachel-Raster ===== */
.admin-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

/* Basis aller Buttons */
.admin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    border-radius: 12px;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.admin-btn:hover { color: white; }
.admin-btn svg { flex-shrink: 0; }

/* Stufe 1: Featured — breit, Verlauf, Icon + Label links + Pfeil rechts. Zentriert, Reste mittig. */
.admin-buttons__featured {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}
.admin-btn--featured {
    flex: 1 1 320px;
    max-width: 640px;
    justify-content: flex-start;
    gap: 0.75rem;
    background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-height: 58px;
}
.admin-btn--featured span { flex: 1; text-align: left; }
/* Einzelner Featured-Button (z.B. nur Booking bei Mitgliedern) → volle Breite, bündig mit den Kacheln */
.admin-btn--featured:only-child { max-width: none; }
.admin-btn__arrow { opacity: 0.5; transition: all 0.2s ease; }
.admin-btn--featured:hover {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.admin-btn--featured:hover .admin-btn__arrow { opacity: 1; transform: translateX(3px); }

/* Ebene 2: Kachel-Raster — füllt IMMER die volle Breite aus, dynamisch je Anzahl.
   --cols (Spalten pro Reihe) wird je nach Anzahl gesetzt; daraus ergibt sich die Kachelbreite
   (volle Breite ÷ Spalten). Wenige Buttons stehen so lange wie sinnvoll in EINER Reihe
   (4→4, 5→5), erst ab vielen wird umgebrochen (10→5+5). Kein Breiten-Deckel mehr → die
   Kacheln ziehen von ganz links nach ganz rechts, bündig mit der Hero-Reihe darüber. */
.admin-tiles {
    --cols: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
}
.admin-tiles[data-count="2"]  { --cols: 2; }  /* eine Reihe */
.admin-tiles[data-count="3"]  { --cols: 3; }  /* eine Reihe */
.admin-tiles[data-count="4"]  { --cols: 4; }  /* eine Reihe */
.admin-tiles[data-count="5"]  { --cols: 5; }  /* eine Reihe */
.admin-tiles[data-count="6"]  { --cols: 6; }  /* eine Reihe */
.admin-tiles[data-count="7"]  { --cols: 4; }  /* 4 + 3 */
.admin-tiles[data-count="8"]  { --cols: 4; }  /* 4 + 4 */
.admin-tiles[data-count="9"]  { --cols: 5; }  /* 5 + 4 */
.admin-tiles[data-count="10"] { --cols: 5; }  /* 5 + 5 */
.admin-tile {
    flex: 1 1 calc(100% / var(--cols) - 0.75rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 92px;
    padding: 1.1rem 1rem;
    background: #111827;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    border-radius: 12px;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.admin-tile svg { flex-shrink: 0; width: 26px; height: 26px; }
.admin-tile:hover {
    color: white;
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Klick-Animation: Press & Bounce */
@keyframes btn-bounce {
    0%   { transform: scale(1); }
    20%  { transform: scale(0.95); }
    50%  { transform: scale(1.03); }
    75%  { transform: scale(0.99); }
    100% { transform: scale(1); }
}

.admin-btn.is-clicked,
.admin-tile.is-clicked {
    animation: btn-bounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Highlight-Button behält border-left beim Bounce */
.admin-btn--highlight.is-clicked {
    animation: btn-bounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Item Action Buttons (Small) */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: #4a5568;
    background: #f1f5f9;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    background: #e2e8f0;
    color: var(--color-black);
    transform: translateY(-1px);
}

.action-btn--delete:hover {
    background: #fee2e2;
    color: #991b1b;
}

/* Dashboard Grid & Cards */
.dashboard-grid {
    position: relative;
    width: 100%;
}

.dashboard-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: absolute;
}

.dashboard-card.masonry-ready {
    transition: top 0.4s ease, left 0.4s ease;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    min-height: 4rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fafafa;
}

.card-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    font-family: var(--font-heading);
}

.card-header h2 svg {
    color: #4a5568;
}

.card-action {
    font-size: 0.8rem;
    color: var(--color-black);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.card-action:hover {
    text-decoration: underline;
    color: var(--color-black);
}

.card-content {
    padding: 1rem 1.5rem;
}

/* Gig Items — Liste mit dezentem Trennstrich, Hover wird grau */
.gig-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: white;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
}
.gig-item:last-child { border-bottom: none; }

.gig-item + .gig-item {
    margin-top: 0;
}

.gig-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0.25rem;
    background: #f3f4f6;
    color: #111;
    border-radius: 10px;
}

.gig-day {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    color: #111;
}

.gig-month {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #6b7280;
}

.gig-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gig-info strong {
    font-size: 0.95rem;
    color: var(--color-text);
}

.gig-info span {
    font-size: 0.85rem;
    color: #6c757d;
}

.gig-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    white-space: nowrap;
}

.status-confirmed,
.status-planning,
.status-pending,
.status-invoice,
.status-completed {
    background: #f3f4f6;
    color: #6b7280;
}
.status-confirmed { color: #047857; }
.status-invoice { color: #b91c1c; font-weight: 700; }

.gig-status-area {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.gig-inv-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    white-space: nowrap;
}
.gig-inv-badge--accepted,
.gig-inv-badge--tentative,
.gig-inv-badge--declined,
.gig-inv-badge--pending {
    background: #f3f4f6;
    color: #6b7280;
}
.gig-inv-badge--accepted { color: #047857; }
.gig-inv-badge--tentative { color: #b45309; }
.gig-inv-badge--declined { color: #b91c1c; }

.gig-item--clickable {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.gig-item--clickable:hover {
    background: #f9fafb;
}


/* Rehearsal date modifier — gleiche Optik wie .gig-date (monochrom) */
.reh-date { background: #f3f4f6; }
.reh-date .gig-day { color: #111; }
.reh-date .gig-month { color: #6b7280; }

.rsvp-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
    color: #6b7280;
}

.rsvp-btn:hover {
    border-color: #d1d5db;
}

.rsvp-btn--confirm:hover,
.rsvp-btn--confirm.active {
    background: #ecfdf5;
    border-color: #10b981;
    color: #059669;
}

.rsvp-btn--maybe:hover,
.rsvp-btn--maybe.active {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #d97706;
}

.rsvp-btn--decline:hover,
.rsvp-btn--decline.active {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

.rsvp-btn--detail:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.empty-hint {
    padding: 1.5rem 0;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

.widget-show-more {
    display: block;
    text-align: center;
    padding: 0.6rem 0;
    margin-top: 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    border-top: 1px solid #f3f4f6;
    transition: color 0.2s;
}
.widget-show-more:hover {
    color: #111;
}

/* Unconfirmed Gigs Section */
.gig-unconfirmed-section {
    margin-top: 0.25rem;
}
.gig-unconfirmed-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    margin-bottom: 0.25rem;
}
.gig-unconfirmed-divider span {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.gig-unconfirmed-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.gig-item--unconfirmed {
    opacity: 0.7;
}
.gig-item--unconfirmed:hover {
    opacity: 1;
}

.gig-unconfirmed-overflow {
    position: relative;
    max-height: 38px;
    overflow: hidden;
    margin-top: 0.15rem;
    /* Fade direkt am unteren Card-Rand */
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
            mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 100%);
}
.gig-unconfirmed-overflow .gig-item { margin-top: 0; }
.gig-unconfirmed-fade {
    display: block;
    text-align: center;
    padding: 0.4rem 0 0;
    margin-top: 0.1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}
.gig-unconfirmed-fade:hover {
    color: #111;
}

/* Setlist Items */
.setlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.setlist-item:last-child {
    border-bottom: none;
}

.setlist-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.setlist-info strong {
    font-size: 0.95rem;
    color: var(--color-text);
}

.setlist-info span {
    font-size: 0.85rem;
    color: #6c757d;
}

.setlist-view {
    font-size: 0.875rem;
    color: var(--color-black);
    text-decoration: none;
    font-weight: 600;
}

.setlist-view:hover {
    text-decoration: underline;
    color: var(--color-black);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-section {
        /* Seiten-Polster auf 0: der innere .container trägt bereits 1rem links/rechts.
           Vorher doppelt (Section 1rem + Container 1rem = 32px) → Kästen unnötig schmal.
           Jetzt nur 16px je Seite → Inhalts-Kästen nutzen mehr Bildschirmbreite. */
        padding: 5rem 0 2rem;
    }

    /* Kopfzeile der Dashboard-Kästen auf dem Handy: Titel auf eigene Zeile, Aktions-
       Knöpfe darunter in einer (bei Bedarf umbrechenden) Reihe — sonst quetschen sich
       z.B. bei „Meine Aufgaben" Titel + „+ Neue Aufgabe" + „Alle Aufgaben" zu eng. */
    .card-header {
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        gap: 0.5rem 0.75rem;
        min-height: 0;
    }
    .card-header h2 {
        flex: 1 1 100%;
    }
    .card-action-group {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 0.9rem;
    }

    /* Tablet/Mobil: Hero 1/Reihe, Kacheln 2/Reihe (füllend, schmal genug fürs Handy) */
    .admin-btn--featured { flex-basis: 100%; max-width: none; }
    .admin-tiles[data-count] { --cols: 2; max-width: none; }
    .admin-tile {
        max-width: none;
        min-height: 78px;
        padding: 0.9rem 0.75rem;
        font-size: 0.85rem;
    }

    .dashboard-welcome h1 {
        font-size: 1.5rem;
    }

    .dashboard-grid .dashboard-card {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        margin-bottom: 1rem;
    }
    .dashboard-grid {
        height: auto !important;
    }

    .gig-item {
        flex-wrap: wrap;
    }

    .gig-status-area {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;   /* Status-Plaketten linksbündig statt zentriert */
        align-items: center;
        margin-top: 0.5rem;
    }
}

/* === Tooltip utility (Konvention siehe CLAUDE.md "Tooltips") ===
   Add `data-tooltip="..."` + `aria-label="..."` to any element (statt `title=`)
   to show a soft white tooltip below on hover/focus. */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(-3px);
    background: #ffffff;
    color: #374151;
    padding: 0.3rem 0.55rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.72rem; font-weight: 500; line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 12px 28px rgba(0, 0, 0, 0.16);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease 0.05s, transform 0.15s ease 0.05s;
    z-index: 9999;
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}