:root {
    --td-red: #c62828;
    --td-red-dark: #8e0000;
    --td-gray-dark: #555555;
    --td-gray: #777777;
    --td-bg: #f5f5f5;
    --td-white: #ffffff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--td-bg);
    color: var(--td-gray-dark);
}

/* Links & Buttons */
a {
    color: var(--td-red);
    text-decoration: none;
}
a:hover {
    color: var(--td-red-dark);
}

.td-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--td-red);
    color: #fff;
    padding: 10px 20px;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.25s ease, box-shadow .25s ease, transform .12s ease;
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.25);
}

.td-btn:hover {
    background: var(--td-red-dark);
    color: #fff !important;        /* Text bleibt weiß! */
    box-shadow: 0 6px 18px rgba(198, 40, 40, 0.35);
    transform: translateY(-1px);
}

.td-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(198, 40, 40, 0.25);
}

/* Variante für graue Buttons (Zurück etc.) */
.td-btn.gray {
    background: #f1f1f1;
    color: var(--td-gray-dark);
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.td-btn.gray:hover {
    background: #e4e4e4;
    color: var(--td-gray-dark);
    transform: translateY(-1px);
}

/* Kleinere Buttons */
.td-btn.small {
    padding: 6px 14px;
    font-size: 0.85rem;
}


/* Cards */
.td-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.07);
    margin-bottom: 18px;
}

/* Simple grid */
.td-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

/* Forms */
.td-input,
.td-select,
.td-textarea {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    border: 1px solid #d0c5bc;
    font-size: 0.95rem;
    font-family: inherit;
}
.td-textarea {
    min-height: 90px;
    resize: vertical;
}

/* Tables */
.td-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.td-table th,
.td-table td {
    padding: 6px 8px;
}
.td-table thead tr {
    border-bottom: 1px solid #e0d5cc;
}
.td-table tbody tr {
    border-bottom: 1px solid #f1e6dd;
}

/* BADGE */
.td-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 999px;
    background: #ffe6e6;
    color: var(--td-red-dark);
}

/* TOP ALERT */
.td-alert-error {
    background: #ffe6e6;
    border: 1px solid #ffb3b3;
    color: #8e0000;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 0.7rem;
}

/* ICONS (Simple) */
.td-icon {
    width: 18px;
    text-align: center;
}

/* LOGIN LAYOUT */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-box {
    background: #fff;
    padding: 2rem 2.2rem;
    border-radius: 16px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 380px;
}
.login-logo {
    text-align: center;
    margin-bottom: 1.2rem;
}
.login-logo span {
    display: block;
    font-weight: 800;
    letter-spacing: 0.12em;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--td-gray-dark);
}
.login-logo strong {
    display: block;
    font-size: 1.3rem;
    color: var(--td-red);
}

/* APP LAYOUT */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 250px;
    background: #ffffff;
    border-right: 3px solid var(--td-red);
    display: flex;
    flex-direction: column;
    padding: 18px 16px;
}

.app-logo {
    margin-bottom: 1rem;
}
.app-logo-main {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--td-red);
}
.app-logo-sub {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--td-gray);
}

.app-nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--td-gray);
    margin: 16px 4px 6px;
}

.app-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border-radius: 9px;
    font-size: 0.9rem;
    color: var(--td-gray-dark);
}
.app-nav-link:hover {
    background: #fbeaea;
}
.app-nav-link-active {
    background: #fbeaea;
    color: var(--td-red-dark);
}

.app-sidebar-footer {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--td-gray);
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* MAIN AREA */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;          /* 🔥 WICHTIG */

}

.app-topbar {
    padding: 10px 20px;
    border-bottom: 1px solid #e0d5cc;
    background: rgba(245,245,245,0.9);
    backdrop-filter: blur(10px);
}
.app-topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
}
.app-topbar-sub {
    font-size: 0.8rem;
    color: var(--td-gray);
}

.app-content {
    padding: 20px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}


/* Responsive */
@media (max-width: 900px) {
    .app-shell {
        flex-direction: column;
    }
    .app-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        align-items: center;
        border-right: none;
        border-bottom: 3px solid var(--td-red);
    }
    .app-nav-section-title,
    .app-sidebar-footer {
        display: none;
    }
    .app-main {
        flex: 1;
    }
}
