/* ============================================================
   ADMIN.CSS v4.6 – Unified Responsive Build
   Struktur:
   1. Farben & Grundlayout
   2. Header / Navigation / Footer
   3. Buttons / Links / States
   4. Dashboard (Welcome, Grid, Cards)
   5. Admin-Grids & Cards (Pages, Projects, Modules)
   6. Tabellen
   7. Formulare
   8. Login / Logout / Setup
   9. Animationen
   10. Responsive (Tablet / Mobile / Small)
============================================================ */


/* ============================================================
   1️⃣ GRUNDLAYOUT & FARBEN
============================================================ */
:root {
    --bg-dark: #1a1a1f;
    --bg-card: #2a2a33;
    --accent: #2BB3A2;
    --accent-hover: #25a091;
    --text-main: #f5f5f5;
    --text-muted: #888;
    --error: #ff6b6b;
    --success: #2BB3A2;
    --border-light: rgba(255,255,255,0.08);
}

body {
    font-family: "Inter", sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    color: var(--accent);
    margin-top: 0;
    margin-bottom: 0.5rem;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .2s;
}

    a:hover {
        color: var(--accent-hover);
        text-decoration: underline;
    }

.text-muted, .muted {
    color: var(--text-muted);
}

.error {
    color: var(--error);
}

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

.glass {
    background: rgba(30, 30, 40, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    padding: 1.5rem;
    box-sizing: border-box;
}


/* ============================================================
   2️⃣ HEADER / NAVIGATION / FOOTER
============================================================ */
.admin-header {
    background: rgba(42,42,51,0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    color: var(--text-main);
}

.admin-header h1 {
    color: var(--accent);
    font-size: 1.4rem;
    margin: 0;
}

.admin-header__left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-header__right {
    position: relative;
}

#menu-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    display: none; /* Mobile sichtbar */
}

/* Navigation */
.admin-nav ul {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    background: var(--bg-card);
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-light);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    animation: fadeInUp .25s ease forwards;
}

/* Sichtbarkeit per JS-Toggle (Burger-Menü) */
.admin-nav ul.show {
    display: flex;
}

.admin-nav a {
    color: var(--text-main);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    padding-bottom: .2rem;
    transition: all .2s;
    width: 100%;
    padding: .6rem 0;
}

    .admin-nav a:hover,
    .admin-nav a.active {
        color: var(--accent);
        border-bottom-color: var(--accent);
    }

.admin-main {
    padding: 2rem;
}

.user-menu {
    position: relative;
}

#user-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .6rem;
    border-radius: 6px;
    transition: background .2s;
}

    #user-btn:hover {
        background: rgba(255,255,255,0.08);
    }

.user-dropdown {
    position: absolute;
    right: 0;
    top: 120%;
    background: var(--bg-card);
    list-style: none;
    margin: 0;
    padding: .4rem 0;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    display: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    min-width: 160px;
    animation: fadeInUp .25s ease forwards;
}

    .user-dropdown li a {
        display: block;
        color: var(--text-main);
        padding: .5rem 1rem;
        text-decoration: none;
        transition: background .2s;
    }

        .user-dropdown li a:hover {
            background: rgba(255,255,255,0.05);
            color: var(--accent);
        }

    .user-dropdown.show {
        display: block;
    }


/* ============================================================
   3️⃣ BUTTONS & LINKS
============================================================ */
button, .button {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: .6rem 1.2rem;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
}

    button:hover, .button:hover {
        background: var(--accent-hover);
    }

    .button.secondary {
        background: #3a3a45;
        color: #ccc;
    }

    .button.small {
        padding: .4rem .9rem;
        font-size: .9rem;
    }

    .button.disabled, button:disabled {
        background: #444;
        color: #999;
        cursor: not-allowed;
    }

    .button:active {
        transform: scale(0.98);
        filter: brightness(1.1);
    }

/* ============================================================
   4️⃣ DASHBOARD
============================================================ */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr; /* linke Seite breiter */
    gap: 2rem;
    align-items: start;
}

.dashboard-left,
.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dashboard-top-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

    .dashboard-top-grid .left,
    .dashboard-top-grid .right {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

@media (max-width: 1024px) {
    .dashboard-top-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-latest,
.dashboard-cards {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 1rem;
}

/* Responsive: auf Tablet & Handy untereinander */
@media (max-width: 1024px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}
    
    .dashboard-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 2rem;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    /* Willkommen */
    .dashboard-welcome {
        text-align: center;
    }

        .dashboard-welcome .glass {
            display: inline-block;
            padding: 2rem 3rem;
            border-radius: 14px;
        }

        .dashboard-welcome h1 {
            font-size: 2rem;
            color: #fff;
            margin: 0 0 .5rem;
        }

        .dashboard-welcome p {
            color: #aaa;
            margin: 0 0 1rem;
        }

    .quick-actions {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: .75rem;
    }

    /* Grid-Bereich (Übersicht, Heute, Systemstatus) */
    .dashboard-overview-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 1fr;
        gap: 2rem;
        align-items: stretch;
    }

        .dashboard-overview-grid > section {
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            height: 100%;
        }

        .dashboard-overview-grid h2 {
            margin-bottom: 1rem;
        }

        .dashboard-overview-grid .muted.small {
            margin: 0;
            padding-top: .5rem;
            text-align: right;
            color: var(--text-muted);
            font-size: .85rem;
        }

    /* Statistik */
    .stats-grid {
        display: flex;
        flex-direction: column;
        gap: .8rem;
    }

    .stat-box {
        background: #1f1f27;
        border-radius: 10px;
        padding: 1rem;
        display: flex;
        align-items: center;
        gap: .8rem;
        transition: .2s;
    }

        .stat-box:hover {
            background: #2a2a33;
        }

        .stat-box strong {
            color: var(--accent);
            font-size: 1.2rem;
        }

    /* Heute */
    .dashboard-info .info-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .8rem 1rem;
    }

    .dashboard-info .label {
        color: #aaa;
        font-size: .85rem;
    }

    .dashboard-info strong {
        color: var(--accent);
    }

    /* Systemstatus */
    .system-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

        .system-list li {
            display: flex;
            justify-content: space-between;
            padding: .3rem 0;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }

    /* Zuletzt hinzugefügt */
    .dashboard-latest header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
    }

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

    .latest-card {
        background: var(--bg-card);
        border-radius: 8px;
        padding: 1rem;
        transition: .2s;
    }

        .latest-card:hover {
            background: #32323c;
        }

        .latest-card h3 {
            color: var(--accent);
            margin-bottom: .3rem;
        }

        .latest-card time {
            font-size: .85rem;
            color: var(--text-muted);
        }

    /* CMS-Funktionen */
    .dashboard-modules {
        margin-top: 3rem;
        text-align: center;
    }

    .dashboard-cards-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 2rem;
    }

    .dashboard-card {
        background: rgba(30,30,40,0.6);
        backdrop-filter: blur(12px);
        border: 1px solid var(--border-light);
        border-radius: 12px;
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        transition: .25s;
    }

        .dashboard-card:hover {
            background: rgba(45,45,55,0.7);
            transform: translateY(-3px);
        }

            .dashboard-card:hover::after {
                content: "";
                position: absolute;
                inset: 0;
                background: linear-gradient(145deg, rgba(43,179,162,0.05), transparent 70%);
                border-radius: inherit;
            }

        .dashboard-card.active {
            border: 1px solid var(--accent);
            box-shadow: 0 0 15px rgba(43,179,162,0.35);
            background: rgba(45,45,55,0.8);
        }

        .dashboard-card.disabled {
            opacity: .5;
            pointer-events: none;
        }


    /* ============================================================
   5️⃣ PAGE / PROJECT / MODULE CARDS
============================================================ */
    .admin-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .admin-card {
        background: var(--bg-card);
        border-radius: 10px;
        padding: 1.5rem;
        box-shadow: 0 4px 12px rgba(0,0,0,.3);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        transition: .25s;
    }

        .admin-card:hover {
            background: #32323c;
            transform: translateY(-2px);
        }

        .admin-card h3 {
            color: var(--accent);
            margin-bottom: .5rem;
        }

        .admin-card p {
            color: #ccc;
            flex-grow: 1;
        }


    /* ============================================================
   6️⃣ TABELLEN
============================================================ */
    .admin-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 1.5rem;
    }

        .admin-table th, .admin-table td {
            padding: .6rem 1rem;
            border-bottom: 1px solid #333;
            text-align: left;
        }

        .admin-table th {
            background: #222;
            color: #ddd;
        }

        .admin-table tr:hover {
            background: #2f2f39;
        }


    /* ============================================================
   7️⃣ FORMULARE
============================================================ */
    form {
        margin-top: 1rem;
        background: #2a2a33;
        padding: 1.5rem;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0,0,0,.3);
    }

        form label {
            display: block;
            margin-top: .8rem;
            color: #ccc;
        }

        form input, form textarea, form select {
            width: 100%;
            background: #3a3a45;
            color: #fff;
            border: none;
            border-radius: 6px;
            padding: .6rem;
            margin-top: .3rem;
        }

    .form-buttons {
        display: flex;
        gap: 1rem;
        margin-top: 1rem;
    }


    /* ============================================================
   8️⃣ LOGIN / LOGOUT / SETUP / STATUS
============================================================ */
    .login-container,
    .logout-section,
    .setup-section {
        max-width: 420px;
        margin: 5rem auto;
        text-align: center;
    }

    .login-card {
        background: var(--bg-card);
        padding: 2rem;
        border-radius: 12px;
        box-shadow: 0 4px 18px rgba(0,0,0,.4);
    }

        .login-card h2 {
            color: var(--accent);
            margin-bottom: 1rem;
        }

        .login-card input {
            width: 100%;
            background: #333;
            border: none;
            color: #fff;
            border-radius: 6px;
            padding: .7rem;
            margin-top: .6rem;
        }

        .login-card button {
            width: 100%;
            margin-top: 1rem;
        }

    .status-ok {
        color: var(--accent);
        font-weight: bold;
    }

    .status-error {
        color: var(--error);
        font-weight: bold;
    }

    .logout-section, .setup-section {
        background: var(--bg-card);
        padding: 2rem;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0,0,0,.3);
        margin-top: 2rem;
    }

        .logout-section h2, .setup-section h2 {
            color: var(--accent);
            margin-bottom: 1rem;
        }


    /* ============================================================
   9️⃣ ANIMATIONEN
============================================================ */
    .fade-in-up {
        opacity: 0;
        transform: translateY(20px);
        animation: fadeInUp .6s ease forwards;
    }

    @keyframes fadeInUp {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }


/* ============================================================
   🔟 RESPONSIVE DESIGN
============================================================ */

/* Tablet – bis 1024px */
@media (max-width: 1024px) {
    .dashboard-overview-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

/* Mobile – bis 768px */
@media (max-width: 768px) {
    #menu-toggle {
        display: block;
    }

    .dashboard-container {
        padding: 1rem;
    }

    .admin-header,
    .admin-footer {
        flex-direction: column;
        gap: 1rem;
    }

    .dashboard-overview-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        flex-direction: column;
        align-items: center;
    }

    .form-buttons {
        flex-direction: column;
    }

    .login-container {
        margin: 2rem auto;
        padding: 0 1rem;
    }
}

/* Small Devices – bis 480px */
@media (max-width: 480px) {
    body {
        font-size: 0.95rem;
    }

    .dashboard-welcome .glass {
        padding: 1rem 1.5rem;
    }

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

    .admin-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    button,
    .button {
        width: 100%;
        text-align: center;
    }

    .admin-main {
        padding: 1rem;
    }
}

/* ============================================================
   FOOTER – Modern Glass Style (passend zum Header)
============================================================ */
.admin-footer {
    background: rgba(42, 42, 51, 0.85);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.95rem;
    position: relative;
    z-index: 50;
}

    .admin-footer a {
        color: var(--accent);
        text-decoration: none;
        font-weight: 500;
    }

        .admin-footer a:hover {
            color: var(--accent-hover);
            text-decoration: underline;
        }

.footer-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-user {
    color: var(--accent);
    font-weight: 500;
}

.footer-sep {
    opacity: 0.4;
}

/* Mobile Anpassung für Footer */
@media (max-width: 768px) {
    .admin-footer {
        flex-direction: column;
        text-align: center;
    }

    .footer-right {
        justify-content: center;
    }
}

/* ============================================================
   DASHBOARD LAYOUT (Sidebar + Main + Header)
   Ergänzung für admin-layout Struktur
============================================================ */

.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 60px); /* Platz unter globalem Header */
}

/* Sidebar links */
.admin-sidebar {
    background: rgba(30, 30, 40, 0.6);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-light);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 10;
}

    .admin-sidebar nav {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-sidebar a {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        color: var(--text-main);
        padding: 0.7rem 1rem;
        border-radius: 8px;
        transition: background 0.2s, color 0.2s;
    }

        .admin-sidebar a:hover {
            background: rgba(255,255,255,0.05);
            color: var(--accent);
        }

        .admin-sidebar a.active {
            background: rgba(43,179,162,0.15);
            color: var(--accent);
            font-weight: 600;
        }

/* Hauptbereich rechts */
.admin-main-area {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

/* Dashboard-Header mit Breadcrumb + Suche + Profil */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(42,42,51,0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.breadcrumb {
    color: var(--text-muted);
    font-size: 0.95rem;
}

    .breadcrumb .current {
        color: var(--text-main);
        font-weight: 500;
    }

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-input {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    color: var(--text-main);
    min-width: 180px;
}

    .search-input:focus {
        outline: none;
        border-color: var(--accent);
    }

.profile-mini {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

    .profile-mini img.avatar {
        border-radius: 50%;
        width: 32px;
        height: 32px;
        object-fit: cover;
        border: 1px solid var(--border-light);
    }

/* Responsive Anpassung */
@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 200px 1fr;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        flex-direction: row;
        justify-content: space-around;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
}