:root {
    --df-bg: #f5f7fa;
    --df-bg-soft: #ffffff;
    --df-border-subtle: #e3e8f0;
    --df-teal: #1f7a78;
    --df-teal-soft: #e0f3f1;
    --df-teal-dark: #155956;
    --df-accent: #ff7b5c;
    --df-accent-soft: #ffe1d8;
    --df-text-main: #1f2933;
    --df-text-muted: #6b7280;
    --df-radius-lg: 16px;
    --df-radius-md: 10px;
    --df-shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
    --df-shadow-card: 0 14px 35px rgba(15, 23, 42, 0.08);
}

/* --------------------
   Global & Typography
   -------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--df-text-main);
    background: var(--df-bg);
}

/* --------------------
   Login Page
   -------------------- */

body.login {
    background: var(--df-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: #ffffff;
    padding: 24px 26px 22px;
    border-radius: var(--df-radius-lg);
    box-shadow: var(--df-shadow-soft);
    width: 340px;
}

.login-box h1 {
    font-size: 20px;
    margin: 0 0 10px;
    color: var(--df-teal-dark);
}

.login-box label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--df-text-main);
}

.login-box input[type="password"] {
    width: 100%;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid var(--df-border-subtle);
    font-size: 13px;
    margin-bottom: 10px;
}

.login-box input[type="password"]:focus {
    outline: none;
    border-color: var(--df-teal);
    box-shadow: 0 0 0 1px rgba(31, 122, 120, 0.12);
}

.login-box button {
    width: 100%;
    padding: 9px 0;
    border-radius: 999px;
    border: none;
    font-size: 14px;
    background: var(--df-accent);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.login-box button:hover {
    background: #ff6a45;
    box-shadow: 0 10px 18px rgba(255, 123, 92, 0.3);
}

.login-box .error {
    color: #b30000;
    font-size: 13px;
    margin-bottom: 8px;
}

.login-box .hint {
    font-size: 12px;
    color: var(--df-text-muted);
    margin-top: 6px;
}

/* --------------------
   App Layout
   -------------------- */

body.app {
    background: var(--df-bg);
}

.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */

.sidebar {
    width: 250px;
    background: var(--df-teal-dark);
    color: #e5f3f2;
    display: flex;
    flex-direction: column;
    padding: 18px 18px 20px;
}

.sidebar-brand {
    padding: 4px 4px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    margin-bottom: 16px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo-icon i {
    font-size: 18px;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
}

.sidebar-logo-title {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-logo-subtitle {
    font-size: 11px;
    opacity: 0.8;
}

.sidebar-nav {
    flex: 1;
    margin-top: 10px;
}

.sidebar-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .55;
    margin: 14px 4px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 2px 0;
    border-radius: 10px;
    font-size: 13px;
    text-decoration: none;
    color: #eaf6f5;
    opacity: 0.9;
    transition: background 0.15s ease, transform 0.1s ease, opacity 0.1s ease;
}

.sidebar-link i {
    font-size: 16px;
    width: 18px;
    text-align: center;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(1px);
    opacity: 1;
}

.sidebar-link.is-active {
    background: #ffffff;
    color: var(--df-teal-dark);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

/* Main / Topbar */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--df-bg);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--df-border-subtle);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-left {
    display: flex;
    flex-direction: column;
}

.topbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--df-teal-dark);
}

.topbar-subtitle {
    font-size: 12px;
    color: var(--df-text-muted);
    margin-top: 2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--df-border-subtle);
    background: #f9fafb;
    min-width: 220px;
}

.topbar-search i {
    font-size: 14px;
    color: var(--df-text-muted);
}

.topbar-search input {
    border: none;
    background: transparent;
    font-size: 12px;
    color: var(--df-text-muted);
    width: 100%;
}

.topbar-search input:focus {
    outline: none;
}

.topbar-icon-btn {
    border: none;
    background: #ffffff;
    border-radius: 999px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: var(--df-text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.topbar-icon-btn:hover {
    background: var(--df-accent-soft);
    color: var(--df-accent);
    box-shadow: 0 6px 12px rgba(255, 123, 92, 0.3);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 10px 3px 4px;
    border-radius: 999px;
    background: #f9fafb;
    border: 1px solid var(--df-border-subtle);
}

.topbar-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--df-teal-soft);
    color: var(--df-teal-dark);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.topbar-user-name {
    font-size: 12px;
}

.topbar-user-role {
    font-size: 10px;
    color: var(--df-text-muted);
}

/* Content */

.content {
    padding: 20px 24px 28px;
}

/* Footer */

.app-footer {
    padding: 12px 24px 18px;
    font-size: 12px;
    color: var(--df-text-muted);
}

/* --------------------
   Cards & Utilities
   -------------------- */

.card {
    background: #ffffff;
    border-radius: var(--df-radius-lg);
    padding: 16px 18px;
    box-shadow: var(--df-shadow-card);
    border: 1px solid var(--df-border-subtle);
    margin-bottom: 18px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
}

.card-subtitle {
    font-size: 12px;
    color: var(--df-text-muted);
}

/* --------------------
   Tabellen & Badges
   -------------------- */

table {
    border-collapse: collapse;
    width: 100%;
    background: #ffffff;
    border-radius: var(--df-radius-lg);
    overflow: hidden;
    border: 1px solid var(--df-border-subtle);
    font-size: 13px;
}

th, td {
    padding: 9px 10px;
    text-align: left;
}

th {
    background: #f9fafb;
    font-size: 12px;
    color: var(--df-text-muted);
    border-bottom: 1px solid var(--df-border-subtle);
}

td {
    border-bottom: 1px solid #f1f5f9;
}

tr:hover td {
    background: #f9fbff;
}

.badge {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge-open {
    background: #fef3c7;
    color: #92400e;
}

.badge-done {
    background: #dcfce7;
    color: #166534;
}

.badge-critical {
    background: #fee2e2;
    color: #991b1b;
}

/* Kleinere Text-Hilfe */

.small {
    font-size: 12px;
    color: var(--df-text-muted);
}

/* --------------------
   Formulare
   -------------------- */

form {
    background: #ffffff;
    padding: 14px 16px;
    border-radius: var(--df-radius-md);
    border: 1px solid var(--df-border-subtle);
    box-shadow: var(--df-shadow-soft);
    margin-bottom: 18px;
}

label {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--df-text-main);
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 7px 8px;
    margin-top: 2px;
    border-radius: 8px;
    border: 1px solid var(--df-border-subtle);
    font-size: 13px;
    background: #f9fafb;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--df-teal);
    box-shadow: 0 0 0 1px rgba(31, 122, 120, 0.12);
    background: #ffffff;
}

textarea {
    min-height: 70px;
}

button {
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    background: var(--df-teal);
    color: #ffffff;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

button:hover {
    background: var(--df-teal-dark);
    box-shadow: 0 10px 20px rgba(21, 89, 86, 0.32);
    transform: translateY(-1px);
}

/* Kleinere Screengrößen */

@media (max-width: 960px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        padding: 10px 14px;
        overflow-x: auto;
    }

    .sidebar-nav {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 0;
        margin-left: 12px;
    }

    .sidebar-section-label {
        display: none;
    }

    .main {
        min-height: calc(100vh - 60px);
    }

    .topbar {
        padding: 10px 14px;
    }

    .content {
        padding: 14px;
    }

    .topbar-search {
        display: none;
    }
}

.dashboard-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-left: auto;
    margin-right: 14px;
}

.dashboard-icon.teal {
    background: var(--df-teal-soft);
    color: var(--df-teal-dark);
}

.dashboard-icon.teal-soft {
    background: #e6f4f3;
    color: #2f6664;
}

.dashboard-icon.coral {
    background: var(--df-accent-soft);
    color: var(--df-accent);
}

.dashboard-icon.green {
    background: #dcfce7;
    color: #166534;
}

.dashboard-number {
    font-size: 26px;
    font-weight: 700;
    color: var(--df-text-main);
    margin-right: 6px;
}

.dashboard-number-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 4px;
}

.dashboard-number {
    font-size: 26px;
    font-weight: 700;
    color: var(--df-text-main);
}

.dashboard-subnumber {
    font-size: 11px;
    color: var(--df-text-muted);
    margin-top: 2px;
}

tfoot td {
    background: #f9fafb;
    border-top: 1px solid var(--df-border-subtle);
}



