/* =====================================================================
   Kaisers Gartenbau – Dashboard (Phase 3)
   - Großer Greeting
   - 6 Apple-Tiles
   - FABs unten rechts
   - Welcome-Modal
   ===================================================================== */

.kg-dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 96px;
}

.kg-dashboard-greeting {
    margin-bottom: 36px;
}

.kg-greeting-title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: var(--kg-text-primary);
    margin: 0 0 8px;
}

.kg-greeting-name {
    color: var(--kg-green-700);
}

.kg-greeting-sub {
    font-size: 18px;
    color: var(--kg-text-secondary);
    margin: 0;
    font-weight: 400;
}


/* ---- Tile-Grid ----------------------------------------------------- */
.kg-tile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.kg-tile {
    position: relative;
    display: block;
    padding: 24px 24px 22px;
    background: var(--kg-bg-card);
    border-radius: var(--kg-radius-xl);
    box-shadow: var(--kg-shadow-sm);
    text-decoration: none !important;
    color: var(--kg-text-primary);
    transition: transform 0.18s cubic-bezier(.2,.8,.2,1),
                box-shadow 0.18s ease,
                background 0.18s ease;
    overflow: hidden;
    min-height: 168px;
}

.kg-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--kg-green-50) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.kg-tile:hover,
.kg-tile:focus {
    transform: translateY(-2px);
    box-shadow: var(--kg-shadow-md);
    color: var(--kg-text-primary);
    text-decoration: none;
}
.kg-tile:hover::before { opacity: 1; }

.kg-tile:active {
    transform: translateY(0);
}


.kg-tile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.kg-tile-icon {
    font-size: 32px;
    line-height: 1;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--kg-green-50);
    border-radius: var(--kg-radius-lg);
}

.kg-tile-count {
    font-size: 30px;
    font-weight: 700;
    color: var(--kg-green-700);
    line-height: 1;
    letter-spacing: -0.02em;
    font-feature-settings: 'tnum';
}

.kg-tile-body {
    position: relative;
    z-index: 1;
}

.kg-tile-label {
    font-size: 20px;
    font-weight: 600;
    color: var(--kg-text-primary);
    margin: 0 0 4px;
    letter-spacing: -0.015em;
}

.kg-tile-sub {
    font-size: 14px;
    color: var(--kg-text-secondary);
    margin: 0;
    line-height: 1.4;
}

.kg-tile-arrow {
    position: absolute;
    right: 22px;
    bottom: 18px;
    font-size: 22px;
    color: var(--kg-text-tertiary);
    transition: transform 0.18s ease, color 0.18s ease;
    z-index: 1;
}

.kg-tile:hover .kg-tile-arrow {
    color: var(--kg-green-700);
    transform: translateX(4px);
}


/* ---- FAB-Container unten rechts ----------------------------------- */
.kg-fab-container {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.kg-fab {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(45, 74, 43, 0.35);
    background: var(--kg-green-700);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, background 0.15s ease;
    padding: 0;
}

.kg-fab:hover,
.kg-fab:focus {
    transform: scale(1.06);
    background: var(--kg-green-900);
    color: #fff;
    outline: none;
}

.kg-fab:active {
    transform: scale(0.98);
}


/* ---- Welcome-Modal ----------------------------------------------- */
.kg-welcome-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 25, 14, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.kg-welcome-modal-backdrop.is-visible {
    display: flex;
    opacity: 1;
}

.kg-welcome-modal {
    background: var(--kg-bg-card);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.18);
    width: 100%;
    max-width: 540px;
    padding: 36px 36px 32px;
    text-align: center;
    transform: translateY(12px) scale(0.97);
    transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
}

.kg-welcome-modal-backdrop.is-visible .kg-welcome-modal {
    transform: translateY(0) scale(1);
}

.kg-welcome-plants {
    position: relative;
    height: 140px;
    margin: 4px auto 16px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 14px;
}

.kg-plant {
    font-size: 60px;
    line-height: 1;
    transform-origin: 50% 100%;
    animation: kg-plant-sway 3.4s ease-in-out infinite;
    filter: drop-shadow(0 2px 6px rgba(45, 74, 43, 0.18));
}

.kg-plant:nth-child(1) { animation-delay: 0s;    font-size: 56px; }
.kg-plant:nth-child(2) { animation-delay: 0.4s;  font-size: 72px; }
.kg-plant:nth-child(3) { animation-delay: 0.8s;  font-size: 56px; }
.kg-plant:nth-child(4) { animation-delay: 1.2s;  font-size: 64px; }

@keyframes kg-plant-sway {
    0%, 100% { transform: rotate(-3deg) translateY(0); }
    50%      { transform: rotate(3deg)  translateY(-4px); }
}

.kg-welcome-headline {
    font-size: 26px;
    font-weight: 700;
    color: var(--kg-text-primary);
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

.kg-welcome-text {
    font-size: 16px;
    color: var(--kg-text-secondary);
    line-height: 1.5;
    margin: 0 0 28px;
}

.kg-welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kg-welcome-actions .btn {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    min-height: 50px;
}


/* ---- Mobile-Anpassungen Dashboard --------------------------------- */
@media (max-width: 768px) {
    .kg-dashboard {
        padding: 20px 14px 110px;
    }

    .kg-greeting-title {
        font-size: 30px;
    }

    .kg-greeting-sub {
        font-size: 16px;
    }

    .kg-tile-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .kg-tile {
        min-height: 0;
        padding: 18px 18px 16px;
    }

    .kg-tile-icon {
        width: 44px;
        height: 44px;
        font-size: 24px;
        border-radius: var(--kg-radius-md);
    }

    .kg-tile-count {
        font-size: 24px;
    }

    .kg-tile-label {
        font-size: 17px;
    }

    .kg-tile-sub {
        font-size: 13px;
    }

    .kg-fab-container {
        right: 14px;
        bottom: 14px;
        gap: 10px;
    }

    .kg-fab {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }

    .kg-welcome-modal {
        padding: 28px 22px 24px;
        border-radius: 22px;
    }
    .kg-welcome-headline { font-size: 22px; }
    .kg-welcome-text { font-size: 15px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .kg-tile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
