* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f6f9;
    --sidebar: #111827;
    --sidebar-hover: #1f2937;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --white: #ffffff;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
}

body {
    margin: 0;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bg);
    color: var(--text);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

input,
select,
textarea {
    width: 100%;

    border: 1px solid var(--border);

    border-radius: 9px;

    padding: 12px 13px;

    outline: none;

    background: white;

    color: var(--text);

    transition: 0.2s;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.10);
}

input[readonly] {
    background: #f9fafb;

    color: var(--muted);
}

label {
    display: block;

    margin-bottom: 7px;
    margin-top: 16px;

    font-weight: 600;
    font-size: 14px;
}


/* LOGIN */

.login-page {
    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 20px;

    background:
        radial-gradient(
            circle at top left,
            #dbeafe,
            transparent 40%
        ),
        #f4f6f9;
}

.login-card {
    background: white;

    width: 100%;
    max-width: 440px;

    padding: 40px;

    border-radius: 18px;

    box-shadow:
        0 20px 60px
        rgba(0, 0, 0, 0.12);
}

.logo-box {
    display: flex;
    align-items: center;

    gap: 14px;

    margin-bottom: 36px;
}

.logo {
    width: 52px;
    height: 52px;

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 14px;

    background: var(--primary);

    color: white;

    font-size: 26px;
    font-weight: 800;
}

.logo.small {
    width: 40px;
    height: 40px;

    font-size: 20px;

    border-radius: 10px;
}

.logo-box h1 {
    margin: 0;

    font-size: 20px;
}

.logo-box span {
    color: var(--muted);

    font-size: 14px;
}

.login-card h2 {
    margin-bottom: 6px;

    font-size: 28px;
}

.subtitle {
    margin-top: 0;
    margin-bottom: 28px;

    color: var(--muted);
}

.login-card form > button {
    width: 100%;

    margin-top: 24px;

    padding: 13px;

    border: none;

    border-radius: 9px;

    background: var(--primary);

    color: white;

    font-weight: 700;
}

.login-card form > button:hover {
    background: var(--primary-hover);
}

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

    margin-top: 14px;

    min-height: 20px;

    font-size: 14px;
}


/* APP */

.app {
    min-height: 100vh;

    display: flex;
}

.sidebar {
    width: 250px;

    background: var(--sidebar);

    color: white;

    min-height: 100vh;

    padding: 22px 14px;

    position: fixed;

    left: 0;
    top: 0;
    bottom: 0;

    display: flex;

    flex-direction: column;
}

.sidebar-logo {
    display: flex;

    gap: 12px;

    align-items: center;

    padding: 6px 8px 25px 8px;
}

.sidebar-logo strong,
.sidebar-logo span {
    display: block;
}

.sidebar-logo span {
    color: #9ca3af;

    font-size: 12px;

    margin-top: 2px;
}

nav {
    display: flex;

    flex-direction: column;

    gap: 4px;
}

.nav-item,
.logout {
    border: 0;

    background: transparent;

    color: #d1d5db;

    text-align: left;

    padding: 11px 13px;

    border-radius: 8px;
}

.nav-item:hover,
.nav-item.active,
.logout:hover {
    background: var(--sidebar-hover);

    color: white;
}

.nav-item.active {
    font-weight: 700;
}

.logout {
    margin-top: auto;

    color: #fca5a5;
}

.main {
    margin-left: 250px;

    width: calc(100% - 250px);

    min-height: 100vh;
}

.topbar {
    min-height: 95px;

    background: white;

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 35px;
}

.topbar h1 {
    margin: 0;

    font-size: 25px;
}

.topbar p {
    margin: 5px 0 0 0;

    color: var(--muted);

    font-size: 14px;
}

.user-box {
    display: flex;

    align-items: center;

    gap: 10px;
}

.user-box strong,
.user-box span {
    display: block;
}

.user-box span {
    color: var(--muted);

    font-size: 12px;

    margin-top: 2px;
}

.user-icon {
    width: 38px;
    height: 38px;

    background: #e5e7eb;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 800;
}

.page {
    padding: 30px 35px;
}


/* CARDS */

.cards {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}

.card,
.panel {
    background: white;

    border: 1px solid var(--border);

    border-radius: 12px;

    box-shadow:
        0 2px 8px
        rgba(0, 0, 0, 0.03);
}

.card {
    padding: 22px;
}

.card-label {
    display: block;

    color: var(--muted);

    font-size: 14px;

    margin-bottom: 12px;
}

.card-value {
    display: block;

    font-size: 27px;

    margin-bottom: 8px;
}

.card small {
    color: var(--muted);
}

.dashboard-grid {
    display: grid;

    grid-template-columns: 1.4fr 1fr;

    gap: 18px;

    margin-top: 20px;
}

.panel {
    padding: 24px;
}

.panel-header h2 {
    margin: 0;

    font-size: 18px;
}

.panel-header p {
    color: var(--muted);

    margin: 5px 0 0 0;

    font-size: 13px;
}

.overview-list {
    margin-top: 22px;
}

.overview-list div {
    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 14px 0;

    border-bottom: 1px solid var(--border);
}

.overview-list div:last-child {
    border-bottom: 0;
}

.quick-actions {
    margin-top: 22px;

    display: flex;

    flex-direction: column;

    gap: 10px;
}

.quick-actions button {
    border: 1px solid var(--border);

    background: white;

    border-radius: 8px;

    padding: 12px;

    text-align: left;
}

.quick-actions button:hover {
    background: #f9fafb;
}


/* SECTIONS */

.section-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
}

.section-header p {
    margin: 5px 0 0 0;

    color: var(--muted);
}

.primary-button,
.secondary-button {
    border-radius: 8px;

    padding: 11px 16px;

    font-weight: 700;
}

.primary-button {
    border: none;

    background: var(--primary);

    color: white;
}

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

.primary-button:disabled {
    opacity: 0.55;

    cursor: not-allowed;
}

.secondary-button {
    border: 1px solid var(--border);

    background: white;

    color: var(--text);
}

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

.empty {
    text-align: center;

    padding: 45px;

    color: var(--muted);
}

.table-wrapper {
    width: 100%;

    overflow-x: auto;
}

table {
    width: 100%;

    border-collapse: collapse;
}

th,
td {
    text-align: left;

    padding: 13px 12px;

    border-bottom: 1px solid var(--border);

    vertical-align: middle;
}

th {
    font-size: 13px;

    color: var(--muted);

    background: #f9fafb;
}

td {
    font-size: 14px;
}

.status {
    display: inline-flex;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 12px;

    font-weight: 700;
}

.status.open {
    background: #fef3c7;

    color: #92400e;
}

.status.paid {
    background: #dcfce7;

    color: #166534;
}

.status.cancelled {
    background: #fee2e2;

    color: #991b1b;
}

.table-actions {
    display: flex;

    flex-wrap: wrap;

    gap: 6px;
}

.table-action {
    border: 1px solid var(--border);

    background: white;

    padding: 6px 9px;

    border-radius: 7px;

    font-size: 12px;
}

.table-action:hover {
    background: #f9fafb;
}

.table-action.success {
    color: #166534;

    border-color: #bbf7d0;
}

.table-action.danger {
    color: #991b1b;

    border-color: #fecaca;
}


/* SETTINGS */

.settings-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;
}

.settings-header h2 {
    margin: 0;
}

.settings-header p {
    margin: 5px 0 0 0;

    color: var(--muted);
}

.save-state {
    min-height: 20px;

    color: var(--success);

    font-size: 14px;

    font-weight: 600;
}

.settings-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        330px;

    gap: 20px;

    align-items: start;
}

.settings-main {
    min-width: 0;
}

.settings-side {
    display: flex;

    flex-direction: column;

    gap: 20px;

    position: sticky;

    top: 20px;
}

.settings-panel {
    margin-bottom: 20px;
}

.settings-section-title {
    padding-bottom: 18px;

    margin-bottom: 5px;

    border-bottom: 1px solid var(--border);
}

.settings-section-title h3 {
    margin: 0;

    font-size: 18px;
}

.settings-section-title p {
    margin: 5px 0 0 0;

    color: var(--muted);

    font-size: 13px;
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0 15px;
}

.full-width {
    grid-column: 1 / -1;
}

.field-help {
    display: block;

    margin-top: 6px;

    color: var(--muted);

    font-size: 12px;
}

.checkbox-card {
    margin: 16px 0 0 0;

    border: 1px solid var(--border);

    border-radius: 10px;

    padding: 15px;

    display: flex;

    gap: 12px;

    align-items: flex-start;

    cursor: pointer;
}

.checkbox-card input {
    width: 18px;
    height: 18px;

    margin: 2px 0 0 0;

    flex: 0 0 auto;
}

.checkbox-card span {
    display: flex;

    flex-direction: column;

    gap: 4px;
}

.checkbox-card small {
    color: var(--muted);
}

.info-box {
    margin-top: 15px;

    background: #eff6ff;

    border: 1px solid #bfdbfe;

    border-radius: 9px;

    padding: 13px 14px;

    color: #1e3a8a;

    font-size: 13px;
}

.settings-actions {
    display: flex;

    justify-content: flex-end;

    padding-bottom: 25px;
}

.settings-save-button {
    min-width: 220px;

    padding: 13px 20px;
}

.summary-card h3 {
    margin: 0 0 18px 0;

    font-size: 17px;
}

.invoice-preview {
    background: #fafafa;

    border: 1px solid var(--border);

    border-radius: 9px;

    padding: 18px;

    display: flex;

    flex-direction: column;

    gap: 7px;
}

.invoice-preview > span {
    color: var(--muted);

    font-size: 12px;
}

.preview-line {
    height: 1px;

    background: var(--border);

    margin: 8px 0;
}

.settings-status-list div {
    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 11px 0;

    border-bottom: 1px solid var(--border);

    font-size: 14px;
}

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


/* MODALS */

.modal {
    position: fixed;

    inset: 0;

    background:
        rgba(17, 24, 39, 0.60);

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    z-index: 1000;
}

.modal-box {
    width: 100%;
    max-width: 650px;

    max-height: 92vh;

    overflow-y: auto;

    background: white;

    border-radius: 14px;

    padding: 25px;
}

.invoice-modal-box {
    max-width: 1080px;
}

.modal-header {
    display: flex;

    justify-content: space-between;

    align-items: flex-start;
}

.modal-header h2 {
    margin: 0;
}

.modal-subtitle {
    margin: 5px 0 0 0;

    color: var(--muted);

    font-size: 13px;
}

.close-button {
    border: none;

    background: none;

    font-size: 28px;

    line-height: 1;
}

.full-button {
    width: 100%;

    margin-top: 25px;
}


/* INVOICE CREATE */

.invoice-top-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0 18px;
}

.readonly-box {
    width: 100%;

    min-height: 44px;

    display: flex;

    align-items: center;

    border: 1px solid var(--border);

    border-radius: 9px;

    padding: 12px 13px;

    background: #f9fafb;

    font-weight: 700;
}

.invoice-items-section {
    margin-top: 28px;
}

.invoice-items-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    margin-bottom: 15px;
}

.invoice-items-header h3 {
    margin: 0;
}

.invoice-items-header p {
    margin: 5px 0 0 0;

    color: var(--muted);

    font-size: 13px;
}

.invoice-items-table {
    border: 1px solid var(--border);

    border-radius: 10px;

    overflow: hidden;
}

.invoice-item-head,
.invoice-item-row {
    display: grid;

    grid-template-columns:
        minmax(260px, 1fr)
        100px
        140px
        130px
        45px;

    gap: 10px;

    align-items: center;
}

.invoice-item-head {
    padding: 12px;

    background: #f9fafb;

    color: var(--muted);

    font-size: 12px;

    font-weight: 700;
}

.invoice-item-row {
    padding: 10px 12px;

    border-top: 1px solid var(--border);
}

.invoice-item-row input {
    margin: 0;
}

.invoice-item-total {
    text-align: right;

    font-weight: 700;

    font-size: 14px;
}

.remove-item-button {
    width: 34px;
    height: 34px;

    border: 1px solid #fecaca;

    background: #fff;

    color: var(--danger);

    border-radius: 7px;

    font-size: 18px;
}

.invoice-bottom-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        330px;

    gap: 25px;

    margin-top: 25px;
}

.invoice-total-box {
    border: 1px solid var(--border);

    border-radius: 10px;

    padding: 18px;

    display: grid;

    grid-template-columns:
        1fr auto;

    gap: 12px;
}

.invoice-total-box span {
    color: var(--muted);
}

.invoice-total-box strong {
    text-align: right;
}

.invoice-total-divider {
    grid-column: 1 / -1;

    height: 1px;

    background: var(--border);
}

.invoice-total-label {
    font-size: 17px;

    font-weight: 700;

    color: var(--text) !important;
}

.invoice-total-value {
    font-size: 20px;
}

.invoice-total-box small {
    grid-column: 1 / -1;

    color: var(--muted);

    margin-top: 4px;
}

.invoice-form-actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 28px;

    padding-top: 20px;

    border-top: 1px solid var(--border);
}


/* TOAST */

.toast {
    position: fixed;

    right: 25px;
    bottom: 25px;

    max-width: 420px;

    padding: 13px 18px;

    background: #111827;

    color: white;

    border-radius: 8px;

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, 0.20);

    z-index: 5000;
}


/* RESPONSIVE */

@media (max-width: 1200px) {

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-side {
        position: static;

        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 1100px) {

    .cards {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .invoice-item-head,
    .invoice-item-row {
        grid-template-columns:
            minmax(220px, 1fr)
            90px
            120px
            110px
            40px;
    }

}

@media (max-width: 850px) {

    .sidebar {
        width: 205px;
    }

    .main {
        margin-left: 205px;

        width: calc(100% - 205px);
    }

    .dashboard-grid,
    .invoice-bottom-grid {
        grid-template-columns: 1fr;
    }

    .invoice-items-table {
        overflow-x: auto;
    }

    .invoice-item-head,
    .invoice-item-row {
        min-width: 750px;
    }

}

@media (max-width: 650px) {

    .sidebar {
        position: static;

        width: 100%;

        min-height: auto;
    }

    .app {
        display: block;
    }

    .main {
        margin-left: 0;

        width: 100%;
    }

    .topbar {
        padding: 18px;

        height: auto;

        flex-direction: column;

        align-items: flex-start;

        gap: 15px;
    }

    .page {
        padding: 18px;
    }

    .cards,
    .form-grid,
    .invoice-top-grid {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: auto;
    }

    .settings-side {
        grid-template-columns: 1fr;
    }

    .invoice-items-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .invoice-form-actions {
        flex-direction: column-reverse;
    }

    .invoice-form-actions button {
        width: 100%;
    }

}


/* KUNDEN BEARBEITEN */

#customersTable th:last-child,
#customersTable td:last-child {
    width: 130px;
}

#customersTable .table-actions {
    justify-content: flex-start;
}



/* TEST-PDF / VORSCHAU */

.preview-button {
    border: 1px solid #f59e0b;

    background: #fffbeb;

    color: #92400e;

    border-radius: 8px;

    padding: 11px 16px;

    font-weight: 700;
}

.preview-button:hover {
    background: #fef3c7;
}

.preview-button:disabled {
    opacity: 0.55;

    cursor: not-allowed;
}



/* =========================================================
   EINNAHMEN + BELEGE
   ========================================================= */

.extra-page-area {
    margin-top: 22px;
}

.extra-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

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

.extra-summary-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    background: #ffffff;
}

.extra-summary-card span {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.extra-summary-card strong {
    display: block;
    font-size: 24px;
    color: #0f172a;
}

.extra-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px 0;
}

.extra-toolbar-row {
    flex-wrap: wrap;
}

.extra-search,
.extra-select {
    height: 40px;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #ffffff;
    padding: 0 12px;
    font: inherit;
    color: #0f172a;
}

.extra-search {
    width: min(420px, 100%);
}

.extra-select {
    min-width: 180px;
}

.extra-search:focus,
.extra-select:focus {
    outline: 2px solid rgba(37, 99, 235, 0.15);
    border-color: #2563eb;
}

.extra-table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.extra-data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
    background: #ffffff;
}

.extra-data-table th {
    text-align: left;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 13px 12px;
    white-space: nowrap;
}

.extra-data-table td {
    font-size: 13px;
    color: #0f172a;
    border-bottom: 1px solid #e5e7eb;
    padding: 13px 12px;
    vertical-align: middle;
}

.extra-data-table tbody tr:last-child td {
    border-bottom: 0;
}

.extra-data-table tbody tr:hover {
    background: #f8fafc;
}

.extra-money {
    white-space: nowrap;
    font-weight: 600;
}

.extra-status-paid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
}

.extra-type-income {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
}

.extra-type-expense {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
}

.extra-file-name {
    display: block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #475569;
}

.extra-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 11px;
    border-radius: 7px;
    border: 1px solid #dbe2ea;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
}

.extra-action-button:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.extra-empty {
    text-align: center;
    color: #64748b !important;
    padding: 30px !important;
}

@media (max-width: 900px) {
    .extra-summary-grid,
    .extra-summary-grid-3 {
        grid-template-columns: 1fr;
    }

    .extra-table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .extra-search,
    .extra-select {
        width: 100%;
    }
}


/* =========================================================
   AUFGABEN & FRISTEN V20
   ========================================================= */

.tasks-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
}

.tasks-page-header h1 {
    margin: 0 0 4px 0;
    font-size: 24px;
}

.tasks-page-header p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.tasks-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 18px;
}

.tasks-summary-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
}

.tasks-summary-card span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 7px;
}

.tasks-summary-card strong {
    font-size: 25px;
    color: #0f172a;
}

.tasks-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.tasks-toolbar input,
.tasks-toolbar select {
    height: 40px;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    padding: 0 12px;
    background: white;
    font: inherit;
}

.tasks-toolbar input {
    width: 390px;
}

.tasks-table-wrap {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow-x: auto;
}

.tasks-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
}

.tasks-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    padding: 13px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.tasks-table td {
    font-size: 13px;
    padding: 13px 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

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

.tasks-table tbody tr:hover {
    background: #f8fafc;
}

.tasks-empty {
    text-align: center;
    color: #64748b;
    padding: 35px !important;
}

.tasks-badge {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.tasks-badge-open {
    background: #fee2e2;
    color: #991b1b;
}

.tasks-badge-done {
    background: #dcfce7;
    color: #166534;
}

.tasks-priority-normal {
    background: #f1f5f9;
    color: #475569;
}

.tasks-priority-high {
    background: #ffedd5;
    color: #9a3412;
}

.tasks-priority-critical {
    background: #fee2e2;
    color: #991b1b;
}

.tasks-overdue {
    color: #dc2626;
    font-weight: 700;
}

.tasks-title {
    font-weight: 600;
}

.tasks-note {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    max-width: 380px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tasks-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tasks-primary,
.tasks-secondary,
.tasks-row-button {
    border-radius: 8px;
    min-height: 34px;
    padding: 0 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.tasks-primary {
    border: 1px solid #2563eb;
    background: #2563eb;
    color: white;
}

.tasks-secondary,
.tasks-row-button {
    border: 1px solid #dbe2ea;
    background: white;
    color: #0f172a;
}

.tasks-row-success {
    color: #166534;
    border-color: #bbf7d0;
}

.tasks-row-danger {
    color: #b91c1c;
    border-color: #fecaca;
}

.tasks-modal[hidden] {
    display: none !important;
}

.tasks-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 25px;
}

.tasks-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
}

.tasks-modal-card {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    background: white;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 24px 70px rgba(0,0,0,.25);
}

.tasks-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
}

.tasks-modal-head h2 {
    margin: 0 0 4px;
}

.tasks-modal-head p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.tasks-modal-x {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    font-size: 26px;
    cursor: pointer;
}

.tasks-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.tasks-field {
    margin-bottom: 15px;
}

.tasks-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.tasks-field input,
.tasks-field select,
.tasks-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
}

.tasks-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding-top: 17px;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 900px) {
    .tasks-summary {
        grid-template-columns: 1fr 1fr;
    }

    .tasks-toolbar {
        flex-direction: column;
    }

    .tasks-toolbar input,
    .tasks-toolbar select {
        width: 100%;
    }
}

@media (max-width: 650px) {
    .tasks-summary,
    .tasks-form-grid {
        grid-template-columns: 1fr;
    }

    .tasks-page-header {
        align-items: stretch;
        flex-direction: column;
    }
}


/* =========================================================
   AUFGABEN & FRISTEN - FINAL SICHTBAR
   ========================================================= */

#page-tasks.tasks-final-visible {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;

    position: fixed !important;

    left: 208px !important;
    right: 0 !important;

    top: 70px !important;
    bottom: 0 !important;

    z-index: 500 !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    padding: 30px !important;

    box-sizing: border-box !important;

    background: #f5f7fb !important;
}


#page-tasks.tasks-final-visible .tasks-page-header,
#page-tasks.tasks-final-visible .tasks-summary,
#page-tasks.tasks-final-visible .tasks-toolbar,
#page-tasks.tasks-final-visible .tasks-table-wrap {
    display: flex;
}


#page-tasks.tasks-final-visible .tasks-summary {
    display: grid !important;
}


#page-tasks.tasks-final-visible .tasks-table-wrap {
    display: block !important;
}


#page-tasks.tasks-final-visible .tasks-page-header {
    display: flex !important;
}


#page-tasks.tasks-final-visible .tasks-toolbar {
    display: flex !important;
}


@media (max-width: 800px) {

    #page-tasks.tasks-final-visible {
        left: 0 !important;
        top: 70px !important;
        padding: 20px !important;
    }

}


/* =========================================================
   AUSWERTUNGEN V40
   ========================================================= */

.reports-v40 {
    margin-top: 20px;
}

.reports-v40-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.reports-v40-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reports-v40-filter label {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.reports-v40-filter select {
    min-width: 170px;
    height: 40px;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    background: #ffffff;
    padding: 0 12px;
    color: #0f172a;
    font: inherit;
}

.reports-v40-export {
    height: 40px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
    border-radius: 8px;
    padding: 0 15px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.reports-v40-export:hover {
    background: #1d4ed8;
}

.reports-v40-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 18px;
}

.reports-v40-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
}

.reports-v40-card span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 8px;
}

.reports-v40-card strong {
    display: block;
    color: #0f172a;
    font-size: 25px;
}

.reports-v40-card strong.reports-v40-positive {
    color: #15803d;
}

.reports-v40-card strong.reports-v40-negative {
    color: #dc2626;
}

.reports-v40-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
    gap: 18px;
    align-items: start;
}

.reports-v40-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.reports-v40-panel-head {
    padding: 18px 18px 14px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.reports-v40-panel-head h3 {
    margin: 0 0 4px 0;
    color: #0f172a;
    font-size: 17px;
}

.reports-v40-panel-head p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.reports-v40-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.reports-v40-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

.reports-v40-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.reports-v40-table td {
    color: #0f172a;
    font-size: 13px;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.reports-v40-table tbody tr:last-child td {
    border-bottom: 0;
}

.reports-v40-table tbody tr:hover {
    background: #f8fafc;
}

.reports-v40-money {
    font-weight: 600;
    white-space: nowrap;
}

.reports-v40-profit-positive {
    color: #15803d !important;
    font-weight: 700;
}

.reports-v40-profit-negative {
    color: #dc2626 !important;
    font-weight: 700;
}

.reports-v40-empty {
    text-align: center;
    color: #64748b;
    padding: 26px !important;
    font-size: 13px;
}

.reports-v40-categories {
    padding: 18px;
}

.reports-v40-category {
    margin-bottom: 18px;
}

.reports-v40-category:last-child {
    margin-bottom: 0;
}

.reports-v40-category-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 7px;
}

.reports-v40-category-name {
    font-size: 13px;
    color: #0f172a;
    font-weight: 700;
}

.reports-v40-category-sub {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
}

.reports-v40-category-value {
    font-size: 13px;
    color: #0f172a;
    font-weight: 700;
    white-space: nowrap;
}

.reports-v40-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.reports-v40-bar-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 999px;
    min-width: 0;
}

@media (max-width: 1100px) {
    .reports-v40-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reports-v40-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .reports-v40-summary {
        grid-template-columns: 1fr;
    }

    .reports-v40-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .reports-v40-filter select,
    .reports-v40-export {
        width: 100%;
    }
}
