:root {
    --black: #09090b;
    --bg: #f6f5f2;
    --white: #ffffff;
    --text: #18181b;
    --text-soft: #3f3f46;
    --muted: #71717a;
    --muted-light: #a1a1aa;
    --border: #e4e4e7;
    --soft: #fafaf9;
    --soft-hover: #f4f4f5;
    --primary: #27272a;
    --primary-hover: #18181b;
    --accent: #a16207;
    --accent-soft: #fef3c7;
    --success: #3f6212;
    --success-soft: #ecfccb;
    --info: #075985;
    --info-soft: #e0f2fe;
    --danger: #9f1239;
    --danger-soft: #ffe4e6;
    --neutral-badge: #f4f4f5;
    --neutral-text: #52525b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

svg {
    display: block;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 112px;
    height: 100vh;
    background: var(--black);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 14px;
    z-index: 20;
}

.nav-item {
    width: 74px;
    height: 66px;
    color: #fff;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    gap: 5px;
}

    .nav-item.active {
        background: rgba(255, 255, 255, .08);
    }

    .nav-item svg,
    .submenu-link svg,
    .search svg,
    .source-cell svg,
    .sidebar-footer-item svg {
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        flex-shrink: 0;
    }

    .nav-item svg {
        width: 22px;
        height: 22px;
    }

.sidebar-footer {
    margin-top: auto;
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 16px;
    width: 100%;
}

.sidebar-footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 10px;
    opacity: .7;
    text-decoration: none;
}

    .sidebar-footer-item svg {
        width: 18px;
        height: 18px;
    }

.submenu {
    position: fixed;
    left: 110px;
    top: 0;
    width: 240px;
    height: 100vh;
    background: var(--soft);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: none;
    flex-direction: column;
    padding: 20px 16px;
    gap: 6px;
    box-shadow: 12px 0 30px rgba(0, 0, 0, .08);
    z-index: 15;
}

    .submenu.active {
        display: flex;
    }

.submenu-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 6px 8px 12px;
}

.submenu-link {
    padding: 11px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #374151;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
}

    .submenu-link:hover,
    .submenu-link.active {
        background: var(--soft-hover);
        color: #111827;
    }

    .submenu-link svg {
        width: 18px;
        height: 18px;
        color: #6b7280;
    }

.content {
    margin-left: 110px;
    padding: 40px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    flex-direction: column;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.logo {
    height: 62px;
    width: 198px;
    object-fit: contain;
    display: block;
    opacity: .88;
}

.logo-fallback {
    display: inline-flex;
    align-items: center;
    height: 72px;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    color: #2f2f2f;
    white-space: nowrap;
}

    .logo-fallback span {
        color: #ff9200;
        margin-left: 8px;
    }

.page-header h1 {
    font-size: 30px;
    letter-spacing: -.5px;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 14px;
    color: var(--muted);
}




/* KPI */

.kpi-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.kpi-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(228, 228, 231, .9);
    box-shadow: 0 12px 34px rgba(24, 24, 27, .055);
    border-radius: 18px;
    padding: 18px;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
}

    .kpi-card::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(17, 24, 39, .035), transparent 50%);
        pointer-events: none;
    }

.kpi-label,
.kpi-value,
.kpi-sub {
    position: relative;
    color: var(--muted);
    z-index: 1;
}

.kpi-label {
    max-width: calc(100% - 42px);
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: .2px;
}

.kpi-value {
    margin-top: 14px;
    font-size: 25px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -.7px;
    color: #111827;
}

.kpi-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 600;
}

.kpi-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: #f4f4f5;
    color: #52525b;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .kpi-icon svg {
        width: 15px !important;
        height: 15px !important;
        min-width: 15px !important;
        min-height: 15px !important;
        max-width: 15px !important;
        max-height: 15px !important;
        display: block;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.2;
    }

/* Falls das SVG direkt class="kpi-icon" bekommt */
svg.kpi-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    background: none;
    border-radius: 0;
    color: #9ca3af;
    display: block;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2.2 !important;
}





.search-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .04);
}

.search {
    flex: 1;
    min-width: 240px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 9px 12px;
    color: #9ca3af;
}

    .search svg {
        width: 14px;
        height: 14px;
    }

    .search input {
        border: none;
        outline: none;
        width: 100%;
        background: transparent;
        font-size: 14px;
        color: var(--text);
    }

.filter-select {
    appearance: none;
    min-width: 125px;
    background: #ffffff;
    color: #374151;
    border: 1px solid var(--border);
    height: 38px;
    padding: 0 38px 0 14px;
    font-size: 14px;
    border-radius: 12px;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%), linear-gradient(135deg, #6b7280 50%, transparent 50%);
    background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

input[type="date"].filter-select {
    background-image: none; /* entfernt deinen Custom-Pfeil */
    padding-right: 14px; /* wieder normaler Abstand */
}

input[type="date"].filter-select {
    color: #374151;
    line-height: 44px;
}

    .filter-select:hover {
        background-color: #f9fafb;
        border-color: #d1d5db;
    }

    .filter-select:focus {
        outline: none;
        border-color: #111827;
        box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.06);
    }


.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.quick-filter {
    padding: 6px 12px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
}

    .quick-filter:hover {
        background: #f3f4f6;
    }

    .quick-filter.active {
        background: #111827;
        color: #ffffff;
        border-color: #111827;
    }



.primary-button {
    background: #111827;
    color: #fff;
    border: 1px solid #111827;
    height: 44px;
    padding: 0 18px;
    font-size: 14px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
}

.secondary-button {
    background: #fff;
    color: #374151;
    border: 1px solid var(--border);
    height: 40px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
}

    .secondary-button:hover {
        background: #f3f4f6;
    }

.table-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .05);
}

.table-top {
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-top h2 {
    font-size: 18px;
}

.table-top span {
    color: var(--muted);
    font-size: 13px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    text-align: left;
}

th {
    background: #fafafa;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .45px;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .04);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background: #fafafa;
}

.customer-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}

    .customer-avatar.blue {
        background: #2563eb;
    }

.customer-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .customer-cell small {
        color: var(--muted);
        font-size: 12px;
    }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
}

    .badge.open {
        background: var(--neutral-badge);
        color: var(--neutral-text);
    }

    .badge.done {
        background: var(--success-soft);
        color: var(--success);
    }

    .badge.closed {
        background: #f5f5f4;
        color: #78716c;
    }

    .badge.info {
        background: var(--info-soft);
        color: var(--info);
    }

    .badge.blue {
        background: #bfdbfe;
        color: #1e40af;
    }

    .badge.green {
        background: #dcfce7;
        color: #166534;
    }



.badge.warning {
    background: var(--accent-soft);
    color: var(--accent);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    background: #fff;
}

.pagination-info {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

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

.page-button {
    height: 34px;
    min-width: 34px;
    padding: 0 11px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .page-button.active {
        background: #111827;
        border-color: #111827;
        color: #fff;
    }

    .page-button.disabled {
        opacity: .4;
        pointer-events: none;
    }

.empty-state {
    padding: 28px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    border-top: 1px solid var(--border);
    background: #fff;
}

.export-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: #fff;
}

.export-button {
    height: 40px;
    padding: 0 14px;
    border-radius: 11px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all .18s ease;
}

    .export-button svg {
        width: 17px;
        height: 17px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }



    /* PDF */

    .export-button.pdf {
        background: #fff1f2;
        color: #be123c;
        border-color: #fecdd3;
    }

    .export-button.pdf:hover {
        background: #ffe4e6;
        border-color: #fda4af;
    }

    /* Excel */

    .export-button.excel {
        background: #ecfdf5;
        color: #047857;
        border-color: #a7f3d0;
    }

    .export-button.excel:hover {
        background: #d1fae5;
        border-color: #6ee7b7;
    }

.footer-note {
    margin-top: 30px;
    font-size: 11px;
    color: #9ca3af;
    opacity: .85;
    text-align: right;
    line-height: 1.4;
}

.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 20%, rgba(255, 146, 0, .18), transparent 40%), radial-gradient(circle at 80% 80%, rgba(0, 0, 0, .05), transparent 50%), linear-gradient(135deg, #f5f6f8, #eef1f5);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 42px 34px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 25px 70px rgba(0, 0, 0, .08);
    text-align: center;
}

.login-logo {
    width: 280px;
    margin: 0 auto 38px;
    display: block;
}

.login-title {
    margin-bottom: 16px;
}

    .login-title h1 {
        font-size: 18px;
        font-weight: 600;
        letter-spacing: .2px;
        margin-bottom: 2px;
        color: #b8bec7;
    }

    .login-title span {
        display: block;
        font-size: 14px;
        color: #b8bec7;
        line-height: 1.1;
    }

.login-input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 14px;
    padding: 0 14px;
    font-size: 14px;
    background: #fff;
    color: #111827;
}

    .login-input:focus {
        outline: none;
        border-color: #111827;
        box-shadow: 0 0 0 3px rgba(0, 0, 0, .05);
    }

.login-button {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    margin-top: 10px;
}

.forgot {
    display: block;
    margin-top: 18px;
    font-size: 13px;
    color: #ff9200;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
}

.login-footer {
    margin-top: 40px;
    font-size: 10px;
    color: #b0b7c3;
    line-height: 1.3;
}

    .login-footer .dev {
        margin-top: 12px;
        font-size: 10px;
        color: #9ca3af;
    }




.welcome-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 34px;
    max-width: 920px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.05);
}

.welcome-eyebrow {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 18px;
}

.welcome-card h2 {
    font-size: 30px;
    letter-spacing: -0.6px;
    margin-bottom: 14px;
}

.welcome-card p {
    max-width: 760px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 14px;
}

.welcome-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 26px;
}

.welcome-item {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
}

    .welcome-item strong {
        display: block;
        font-size: 14px;
        margin-bottom: 6px;
    }

    .welcome-item span {
        display: block;
        color: var(--muted);
        font-size: 13px;
        line-height: 1.45;
    }



.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 30px;
}

.app-tile {
    aspect-ratio: 1 / 1;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

    .app-tile:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(0,0,0,0.08);
        background: var(--soft-hover);
    }

.app-tile-icon {
    font-size: 34px;
    margin-bottom: 10px;
}

.app-tile-name {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* leichte Hervorhebung */
.app-tile-accent {
    background: var(--accent-soft);
    border-color: var(--accent);
}

    .app-tile-accent:hover {
        background: #fde68a;
    }





.contingent-header-card {
    margin-bottom: 30px;
}

.contingent-card {
    margin-bottom: 40px;
}

    .contingent-card + .contingent-card {
        margin-top: 24px;
    }

.contingent-legend {
    
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 14px;
    padding-bottom: 14px;
    padding-left: 20px;
}

.legend {
    width: 30px;
    height: 6px;
    border-radius: 999px;
    display: inline-block;
}

    .legend.success {
        background: var(--success-soft);
    }

    .legend.warning {
        background: var(--accent-soft);
    }

    .legend.orange {
        background: #ffedd5;
    }

    .legend.danger {
        background: var(--danger-soft);
    }

    .legend.neutral {
        background: var(--info-soft);
    }

.contingent-matrix-wrap {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
}

.contingent-matrix {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

    .contingent-matrix th,
    .contingent-matrix td {
        text-align: center;
        white-space: nowrap;
        padding: 8px 5px;
    }

.sticky-col {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--white);
    text-align: left !important;
    min-width: 170px;
    max-width: 210px;
    font-weight: 500;
}

.month-bar {
    position: relative;
    min-width: 100px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--soft-hover);
}

    .month-bar.year-total {
        width: 138px;
    }

    .month-bar .fill {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        opacity: 0.95;
        z-index: 1;
    }

.month-content {
    position: relative;
    z-index: 5;
    height: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px;
    box-sizing: border-box;
    text-align: center;
}

    .month-content.single {
        gap: 0;
    }

.month-percent {
    display: block !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.month-euro {
    display: block !important;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.month-eurow {
    display: block !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.month-success .fill {
    background: var(--success-soft);
}

.month-warning .fill {
    background: var(--accent-soft);
}

.month-orange .fill {
    background: #ffedd5;
}

.month-danger .fill {
    background: var(--danger-soft);
}

.month-neutral .fill {
    background: var(--info-soft);
}

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

.month-warning {
    color: var(--accent);
}

.month-orange {
    color: #9a3412;
}

.month-danger {
    color: var(--danger);
}

.month-neutral {
    color: var(--info);
}

.month-empty {
    color: var(--muted);
}

.year-total-col {
    border-left: 1px solid var(--border);
    padding-left: 12px !important;
    padding-right: 12px !important;
}

.contingent-matrix td.sticky-col,
.contingent-matrix th.sticky-col {
    padding-left: 20px !important;
    padding-right: 18px !important;
    text-align: left !important;
}

.filter-inline {
    display: flex;
    gap: 10px;
    align-items: center;
}