:root {
    /* Standard: Dark Theme */
    color-scheme: dark;

    --bg: #0f172a;
    --bg-soft: #020617;
    --card: #020617;
    --accent: #38bdf8;
    --accent-soft: rgba(56,189,248,0.15);
    --border: #1f2937;
    --text: #e5e7eb;
    --muted: #9ca3af;

    /* Für Hintergrund-Verläufe */
    --bg-gradient-start: #1d293b;
    --bg-gradient-mid: #020617;
    --bg-gradient-end: #000000;
}

/* Explizit Dark – meist nur gebraucht, falls du später mal umschaltest */
body.theme-dark {
    color-scheme: dark;
}

/* Light Theme: analoge Struktur, aber hell */
body.theme-light {
    color-scheme: light;

    /* etwas softeres, weniger grelles Light Theme */
    --bg: #e5e7eb;            /* allgemeiner Seitenhintergrund */
    --bg-soft: #e5e7eb;       /* weiche Flächen */
    --card: #f9fafb;          /* Karten / Boxen */
    --accent: #0ea5e9;
    --accent-soft: rgba(14,165,233,0.12);
    --border: #cbd5e1;
    --text: #111827;
    --muted: #6b7280;

    --bg-gradient-start: #dbeafe;
    --bg-gradient-mid: #e5e7eb;
    --bg-gradient-end: #f9fafb;
}

header nav {
    display:flex;
    align-items:center;
    gap:10px;
}

/* Vorher hattest du schon etwas wie: header nav a {...} – das kannst du lassen */

.main-nav {
    display:flex;
    align-items:center;
    gap:10px;
}

/* Container für das Hamburger-Menü */
.nav-more {
    margin-left:auto; /* schiebt den Hamburger nach rechts */
    position:relative;
}

/* Button (drei Linien) */
.nav-more-btn {
    background:rgba(15,23,42,0.15);
    border:1px solid rgba(15,23,42,0.4);
    border-radius:999px;
    color:#e5e7eb;
    padding:4px 10px;
    cursor:pointer;
    font-size:1rem;
    display:flex;
    align-items:center;
    justify-content:center;
}

 /* Vertikales Banner als schmale Karte rechts (max 300px) */
        .ad-vertical {
            max-width:300px;
            margin:16px 0 0 auto; /* rechts andocken */
            background:#020617;
            border-radius:16px;
            border:1px dashed rgba(148,163,184,0.6);
            padding:12px;
            box-shadow:0 18px 40px rgba(0,0,0,0.45);
            text-align:center;
            font-size:0.85rem;
        }
        .ad-vertical .ad-title {
            font-weight:600;
            margin-bottom:6px;
        }
        .ad-vertical .ad-dog-icon {
            font-size:2.4rem;
            margin:8px 0;
        }
        .ad-vertical.ad-placeholder {
            color:var(--muted);
        }

        /* Premium-User: Banner ausblenden */
        .user-premium #banner-wrapper {
            display:none;
        }

/* Dropdown-Menü */
.nav-more-menu {
    position:absolute;
    right:0;
    top:120%;
    background:#020617;
    border:1px solid #1f2937;
    border-radius:12px;
    padding:6px 0;
    min-width:150px;
    box-shadow:0 18px 40px rgba(0,0,0,0.55);
    display:none;
    z-index:50;
}

.nav-more-menu a {
    display:block;
    padding:6px 12px;
    font-size:0.85rem;
    text-decoration:none;
    color:#e5e7eb;
    white-space:nowrap;
}

.nav-more-menu a:hover {
    background:rgba(15,23,42,0.6);
}

/* Optional: Logout etwas hervorheben */
.nav-more-menu a.logout {
    color:#f97373;
}


* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui,-apple-system,"Segoe UI",sans-serif;
    background: radial-gradient(
        circle at top left,
        var(--bg-gradient-start) 0,
        var(--bg-gradient-mid) 50%,
        var(--bg-gradient-end) 100%
    );
    color: var(--text);
}

header {
    background: linear-gradient(90deg, #0ea5e9, #38bdf8, #a855f7);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}
.brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(15,23,42,0.15);
display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

header nav a {
    color: #e5e7eb;
    margin-left: 10px;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15,23,42,0.15);
}
header nav a.active {
    background: rgba(15,23,42,0.3);
    font-weight: 600;
}

main {
    max-width: 1200px;
    margin: 20px auto 40px;
    padding: 0 16px;
}

h2 { margin: 8px 0 4px; }
.subtitle { color: var(--muted); font-size: 0.9rem; }

.card {
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 16px;
    margin-top: 16px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.45);
}
.card h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

label {
    display: block;
    margin-top: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--muted);
}
input, textarea, select {
    width: 100%;
    padding: 8px;
    margin-top: 3px;
    border-radius: 10px;
    border: 1px solid #1f2937;
    background: var(--card);
    color: var(--text);
    font-size: 0.9rem;
}
textarea { resize: vertical; min-height: 60px; }

button {
    margin-top: 12px;
    padding: 4px 7px;
    border-radius: 999px;
    border: none;
    background: #38bdf8;
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
button.danger { background: #b91c1c; color: #fee2e2; }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 0.85rem;
}
th, td {
    border-bottom: 1px solid var(--border);
    padding: 6px 6px;
    text-align: left;
}
th {
    color: var(--muted);
    font-weight: 500;
    background: var(--card);
}
tr:nth-child(even) td { background: var(--card); }
tr:nth-child(odd) td { background: var(--card); }

.grid { display: grid; gap: 16px; }

/* Standard-Layouts (Desktop) */
.grid-2 {
    grid-template-columns: 1fr 1fr;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Ab 900px abwärts: 2 Spalten für 3er-Grids */
@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Ab 700px abwärts: alle Grids einspaltig */
@media (max-width: 700px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

.message { font-size: 0.8rem; margin-top: 6px; color: var(--muted); }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background:#0b1120 !important; }

.pill {
    display:inline-flex;
    align-items:center;
    padding:3px 10px;
    border-radius:999px;
    background:var(--accent-soft);
    color:var(--accent);
    font-size:0.75rem;
}

/* Login-Seite */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    max-width: 420px;
    width: 100%;
}

/* Tabs für Unterbereiche (Tierakte etc.) */
.tabs {
    margin: 16px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    padding-bottom: 4px;
}

.tab-button {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--muted);
}

.tab-button.active {
    background: var(--accent-soft, rgba(56, 189, 248, 0.1));
    color: var(--accent-strong, #0ea5e9);
    font-weight: 500;
}

.tab-panel {
    margin-top: 12px;
}


/* === Responsive Header & Navigation === */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15,23,42,0.9);
}

/* Desktop-Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.main-nav a {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
}

.main-nav a:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* Hamburger-Button */
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(148,163,184,0.6);
    border-radius: 999px;
    color: var(--text);
    padding: 4px 10px;
    cursor: pointer;
    font-size: 1rem;
}

/* Mobile / Tablet */
@media (max-width: 800px) {
    .site-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-top: 8px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
    }

    .main-nav.open {
        max-height: 600px;
    }

    .main-nav a {
        width: 100%;
        text-align: left;
        border-radius: 8px;
    }

    /* Tabellen mobil horizontal scrollbar machen */
    .card table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.logo {
    height: 40px;
    width: auto;
    display: block;
    filter: var(--logo-filter);
}

body.theme-dark {
    --logo-filter: brightness(1);
}

body.theme-light {
    --logo-filter: brightness(0.8);
}




/* Light-Theme Overrides für Tabellen & Formulare */
body.theme-light table {
    background: #ffffff;
    color: var(--text);
}

body.theme-light thead {
    background: #e5e7eb;
    color: var(--text);
}

body.theme-light tr:nth-child(even) td {
    background: #f3f4f6;
}

body.theme-light tr:nth-child(odd) td {
    background: #ffffff;
}

body.theme-light input,
body.theme-light select,
body.theme-light textarea {
    background: #ffffff;
    color: var(--text);
    border-color: var(--border);
}

body.theme-light input::placeholder,
body.theme-light textarea::placeholder {
    color: var(--muted);
}


.theme-toggle {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
    background: var(--card);
    color: var(--text);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(15,23,42,0.45);
    opacity: 0.9;
}

.theme-toggle:hover {
    opacity: 1;
    background: var(--accent);
    color: #0f172a;
}

@media (max-width: 600px) {
    .theme-toggle {
        right: 10px;
        bottom: 10px;
        padding: 4px 10px;
        font-size: 0.8rem;
    }
}
