﻿:root {
    /* Base Farver */
    --primary: #1f4b7a;
    --text: #0b1720;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg-app: #f1f5f9;
    --surface: #ffffff;
    --income: #16a34a;
    --income-tint: rgba(22, 163, 74, 0.05);
    --fixed: #1f4b7a;
    --fixed-tint: rgba(31, 75, 122, 0.05);
    --variable: #d97706;
    --variable-tint: rgba(217, 119, 6, 0.05);
    --savings: #0d9488;
    --savings-tint: rgba(13, 148, 136, 0.05);
    --debt: #dc2626;
    --debt-tint: rgba(220, 38, 38, 0.05);
    --remaining: #8b5cf6;
    --gap: 1rem;
    --radius: 16px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 10px rgba(0,0,0,0.05);
}
/* DARK MODE INDSTILLINGER */
[data-theme="dark"] {
    --bg-app: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --border: #334155;
    --income-tint: rgba(22, 163, 74, 0.2);
    --fixed-tint: rgba(59, 130, 246, 0.2);
    --variable-tint: rgba(245, 158, 11, 0.2);
    --savings-tint: rgba(20, 184, 166, 0.2);
    --debt-tint: rgba(239, 68, 68, 0.2);
    --shadow-md: 0 4px 10px rgba(0,0,0,0.5);
}

    [data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator,
    [data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
    [data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
        filter: invert(1);
        cursor: pointer;
        opacity: 0.8;
    }

    [data-theme="dark"] input,
    [data-theme="dark"] select,
    [data-theme="dark"] .table-select {
        background-color: #020617;
        color: white;
        border-color: #334155;
    }

    [data-theme="dark"] .card {
        border: 1px solid #334155; 
    }

html, body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-app);
    margin: 0;
    padding: 0;
    color: var(--text);
    height: 100%;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

* {
    box-sizing: border-box;
}

a, .btn-link {
    color: var(--primary);
    text-decoration: none;
}

#blazor-error-ui {
    display: none !important;
}

.validation-message {
    color: var(--debt);
    font-size: 0.85rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--income);
}

.invalid {
    outline: 1px solid var(--debt);
}

code {
    color: #c02d76;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--primary);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--primary);
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-in {
    animation: slideUpFade 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.btn:active, .tab-btn:active {
    transform: scale(0.95) !important;
    transition: transform 0.1s;
}

.budget-root {
    padding: 1.25rem;
    border-radius: var(--radius);
    color: var(--text);
    height: auto;
    min-height: 100%;
    display: block;
    overflow-x: hidden;
}

    .budget-root h3 {
        max-width: 1000px;
        margin: 0 auto 0.6rem auto;
        font-weight: 800;
        font-size: 1.25rem;
        color: var(--primary);
    }

.toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: .6rem;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    flex-wrap: wrap;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 1.1rem auto;
}

.field {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.field-label {
    font-size: .78rem;
    color: var(--muted);
    margin-bottom: .28rem;
}

.toolbar .field input {
    padding: .5rem .65rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--bg-app);
    width: 100%;
    max-width: 300px;
    outline: none;
    color: var(--text);
    border: 1px solid var(--border);
}

    .toolbar .field input:focus {
        box-shadow: 0 8px 26px rgba(31,75,122,0.06);
        border-color: rgba(31,75,122,0.12);
    }

.toolbar-actions {
    margin-left: auto;
    display: flex;
    gap: .5rem;
}

/* Knapper */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    background: transparent;
    transition: all 0.2s ease;
    line-height: 1;
}

    .btn:hover {
        transform: translateY(-2px);
        opacity: 0.95;
        box-shadow: var(--shadow-sm);
    }

    .btn:active {
        transform: translateY(0);
    }

    .btn.primary {
        background: var(--primary);
        color: #fff;
        box-shadow: var(--shadow-md);
    }

    .btn.ghost {
        background: transparent;
        color: var(--muted);
        border: 1px solid transparent;
    }

        .btn.ghost:hover {
            background-color: rgba(0,0,0,0.05);
            color: var(--text);
        }

    .btn.small {
        height: 30px;
        padding: 0 0.6rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }

/* Grid & Cards */
.budget-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    position: relative;
    border-left: 6px solid transparent;
    width: 100%;
}

    .card:hover {
        transform: translateY(-6px);
        box-shadow: 0 18px 40px rgba(9,20,34,0.07);
    }

    .card h4 {
        margin: 0 0 .6rem 0;
        font-size: 1.02rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: .6rem;
    }

        .card h4::before {
            content: "";
            display: inline-block;
            width: 14px;
            height: 14px;
            border-radius: 3px;
            background: var(--muted);
        }

.table-scroll-wrapper {
    overflow-y: auto;
    max-height: 65vh;
    width: 100%;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--border);
}
/* Tabeller */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0 8px 0;
    font-size: 0.95rem;
    table-layout: auto;
}

    .styled-table th, .styled-table td {
        padding: 12px 8px;
        vertical-align: middle;
        border-bottom: 1px solid rgba(15,20,25,0.04);
    }

    .styled-table thead tr {
        text-align: left;
    }

    .styled-table thead th {
        .styled-table thead th {
            padding: 14px 18px;
            font-weight: 700;
            border: 0;
            white-space: nowrap;
            position: sticky;
            top: 0;
            z-index: 10;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }
    }

        .styled-table thead th:first-child {
            border-top-left-radius: 10px;
            border-bottom-left-radius: 10px;
        }

        .styled-table thead th:last-child {
            border-top-right-radius: 10px;
            border-bottom-right-radius: 10px;
        }

        .styled-table tbody tr {
            transition: background-color 0.1s ease;
        }

            .styled-table tbody tr:hover {
                background-color: rgba(0,0,0,0.02);
            }

[data-theme="dark"] .styled-table thead th {
    background-color: var(--surface);
}

    .styled-table input {
        width: 100%;
        padding: .55rem .3rem;
        border-radius: 8px;
        border: 1px solid rgba(15,20,25,0.04);
        outline: none;
        background: var(--bg-app);
        color: var(--text);
        border: 1px solid var(--border);
    }

.table-select {
    width: 100%;
    padding: .55rem .3rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    outline: none;
    background: var(--bg-app);
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text);
}

    .table-select:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 2px rgba(31,75,122,0.1);
    }

.num {
    text-align: right;
}

/* Row Actions */
.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    height: 100%;
}

    .row-actions .btn {
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        margin: 0;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        border: 1px solid transparent;
    }

        .row-actions .btn:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }

        .row-actions .btn:active {
            transform: scale(0.95);
        }

.btn.save {
    color: white;
    border: none;
}

.row-actions .btn.small:not(.save):not(.ghost) {
    background-color: #fff;
    color: var(--primary);
    border: 1px solid #e2e8f0;
}

    .row-actions .btn.small:not(.save):not(.ghost):hover {
        background-color: #f0f9ff;
        border-color: var(--primary);
    }

.row-actions .btn.ghost {
    background-color: #fff;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
}

    .row-actions .btn.ghost:hover {
        background-color: #fef2f2;
        color: #ef4444;
        border-color: #fee2e2;
    }

/* Card Footer & Totals */
.card-footer {
    display: flex;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.03);
    gap: 15px;
    flex-wrap: wrap;
}

    .card-footer > *:first-child {
        margin-right: auto;
    }

    .card-footer .btn {
        border-radius: 50px;
        padding: 10px 24px;
        font-weight: 800;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.5px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        border: none !important;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: white !important;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        height: 42px;
    }

        .card-footer .btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 16px rgba(0,0,0,0.2);
        }

        .card-footer .btn:active {
            transform: translateY(-1px);
            box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        }

        .card-footer .btn.ghost {
            background: #ffffff !important;
            color: #64748b !important;
            border: 2px solid #e2e8f0 !important;
            box-shadow: none;
        }

            .card-footer .btn.ghost:hover {
                border-color: #94a3b8 !important;
                color: #0f172a !important;
                background: #f8fafc !important;
                transform: translateY(-2px);
            }

    .card-footer .total {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        font-size: 0.75rem;
        color: #64748b;
        line-height: 1.2;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 600;
    }

        .card-footer .total strong {
            font-size: 1.25rem;
            color: var(--text);
            font-weight: 800;
        }

/* Farve-temaer pr. sektion */
/* Income */
.card.card-income {
    border-left-color: var(--income);
}

    .card.card-income .styled-table thead th {
        background-color: var(--income) !important;
        color: white !important;
    }

    .card.card-income .btn.save {
        background-color: var(--income);
    }

    .card.card-income .card-footer .btn:not(.ghost) {
        background: linear-gradient(135deg, var(--income) 0%, #16a34a 100%) !important;
    }

    .card.card-income .total strong {
        color: var(--income);
    }

    .card.card-income .styled-table tbody tr:nth-of-type(even) {
        background-color: var(--income-tint);
    }

    .card.card-income .styled-table::after {
        background: var(--income);
    }

/* Fixed */
.card.card-fixed {
    border-left-color: var(--fixed);
}

    .card.card-fixed .styled-table thead th {
        background-color: var(--fixed) !important;
        color: white !important;
    }

    .card.card-fixed .btn.save {
        background-color: var(--fixed);
    }

    .card.card-fixed .card-footer .btn:not(.ghost) {
        background: var(--fixed) !important;
    }

    .card.card-fixed .total strong {
        color: var(--fixed);
    }

    .card.card-fixed .styled-table tbody tr:nth-of-type(even) {
        background-color: var(--fixed-tint);
    }

    .card.card-fixed .styled-table::after {
        background: var(--fixed);
    }

/* Variable */
.card.card-variable {
    border-left-color: var(--variable);
}

    .card.card-variable .styled-table thead th {
        background-color: var(--variable) !important;
        color: white !important;
    }

    .card.card-variable .btn.save {
        background-color: var(--variable);
    }

    .card.card-variable .card-footer .btn:not(.ghost) {
        background: linear-gradient(135deg, var(--variable) 0%, #d97706 100%) !important;
    }

    .card.card-variable .total strong {
        color: var(--variable);
    }

    .card.card-variable .styled-table tbody tr:nth-of-type(even) {
        background-color: var(--variable-tint);
    }

    .card.card-variable .styled-table::after {
        background: var(--variable);
    }

/* Savings */
.card.card-savings {
    border-left-color: var(--savings);
}

    .card.card-savings .styled-table thead th {
        background-color: var(--savings) !important;
        color: white !important;
    }

    .card.card-savings .btn.save {
        background-color: var(--savings);
    }

    .card.card-savings .card-footer .btn:not(.ghost) {
        background: linear-gradient(135deg, var(--savings) 0%, #0d9488 100%) !important;
    }

    .card.card-savings .total strong {
        color: var(--savings);
    }

    .card.card-savings .styled-table tbody tr:nth-of-type(even) {
        background-color: var(--savings-tint);
    }

    .card.card-savings .styled-table::after {
        background: var(--savings);
    }

    .card.card-savings .styled-table td:first-child .cell-text {
        margin-right: 10px;
        display: inline-block;
    }

/* Debts */
.card.card-debts {
    border-left-color: var(--debt);
}

    .card.card-debts .styled-table thead th {
        background-color: var(--debt) !important;
        color: white !important;
    }

    .card.card-debts .btn.save {
        background-color: var(--debt);
    }

    .card.card-debts .card-footer .btn:not(.ghost) {
        background: linear-gradient(135deg, var(--debt) 0%, #dc2626 100%) !important;
    }

    .card.card-debts .total strong {
        color: var(--debt);
    }

    .card.card-debts .styled-table tbody tr:nth-of-type(even) {
        background-color: var(--debt-tint);
    }

    .card.card-debts .styled-table::after {
        background: var(--debt);
    }

.styled-table::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 4px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    margin: 10px 0;
}

.empty-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.8rem;
    opacity: 0.4;
}

.empty-state p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
}

.tab-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    justify-content: flex-start;
    padding-bottom: 5px;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

    .tab-navigation::-webkit-scrollbar {
        display: none;
    }

@media (min-width: 769px) {
    .tab-navigation {
        justify-content: center;
        overflow-x: visible;
    }
    .fade-overlay {
        display: none;
    }
}

.tab-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    flex: 0 0 auto;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

    .tab-btn:hover {
        background: #f8fafc;
        transform: translateY(-1px);
    }

    .tab-btn.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
        box-shadow: 0 4px 10px rgba(31, 75, 122, 0.25);
    }

.date-cell-view {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 40px;
}

.accounting-badge-top {
    font-size: 0.65rem;
    color: var(--variable);
    font-weight: 600;
    line-height: 1;
    margin-bottom: 2px;
    white-space: nowrap;
    opacity: 0.9;
}

.date-cell-edit {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    width: 100%;
}
.accounting-toggle-top {
    position: relative !important;
    top: auto !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 0 8px 15px;
    margin-right: 0 !important;
    padding-right: 0 !important;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
}

.active-check {
    color: var(--primary);
}

input.date-input-styled {
    text-align: right !important;
    width: 140px !important;
    height: 44px !important;
    padding-right: 0 !important;
    margin-right: 0 !important;
    margin-top: -4px;
    background: transparent !important;
    border: none !important;
    font-size: 1.1rem !important;
    color: var(--text);
    font-family: inherit;
    font-weight: normal !important;
    -webkit-appearance: none;
}
.badge-spacer {
    height: 0.65rem;
    margin-bottom: 2px;
}

    .accounting-toggle-top {
        justify-content: flex-end;
    }

.name-cell-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.created-by-badge {
    font-size: 0.7rem;
    color: var(--muted) !important;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 3px;
    background-color: rgba(0,0,0,0.03);
    padding: 1px 6px;
    border-radius: 10px;
}

.edit-badge {
    background-color: rgba(255, 165, 0, 0.1);
    color: var(--variable);
}

[data-theme="dark"] .created-by-badge {
    background-color: rgba(255,255,255,0.05);
}

[data-theme="dark"] .edit-badge {
    background-color: rgba(255, 165, 0, 0.15);
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    background-color: var(--bg-app);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border);
}

[data-theme="dark"] .category-badge {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.empty-dash {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    opacity: 0.5;
}

.internal-icon {
    color: var(--muted);
    font-size: 1.2rem;
}

.savings-target {
    color: var(--muted);
    font-size: 0.75rem;
    display: block;
}

.savings-amount {
    color: var(--income);
    font-weight: bold;
}

.btn-dashed {
    border: 1px dashed var(--border) !important;
    padding: 0 10px;
    color: var(--muted) !important;
}

.search-field {
    flex: 2;
    min-width: 200px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    color: var(--muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.clear-icon {
    position: absolute;
    right: 10px;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s;
}

    .clear-icon:hover {
        color: var(--debt);
    }

.search-input-wrapper input {
    padding-left: 35px !important;
    padding-right: 30px !important;
    width: 100%;
}

.btn-danger {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--debt);
    border: 1px solid var(--debt);
    font-size: 0.8rem;
    padding: 0 12px;
    height: 32px;
}

    .btn-danger:hover {
        background-color: var(--debt);
        color: white;
    }

/* Mobil tilpasning for tabeller */
@media (max-width: 768px) {
    td[data-label="@Loc["Col_Recurring"]"],
    td[data-label="@Loc["Col_InternalTrans"]"] {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 0 !important;
        width: 100% !important;
    }

    .custom-check {
        width: auto;
        justify-content: flex-end;
    }

        .custom-check label {
            width: 40px; 
            height: 40px;
            justify-content: flex-end;
            font-size: 1.4rem;
        }

    td[data-label]::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--muted);
        text-transform: uppercase;
        font-size: 0.75rem;
    }

    .styled-table thead {
        display: none;
    }

        .tab-navigation {
        justify-content: flex-start;
    }

    td[data-label="Dato"] {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        height: auto !important;
        padding: 12px 0 !important;
    }

        td[data-label="Dato"]::before {
            align-self: flex-start;
            margin-bottom: -20px;
        }

    .accounting-badge-top {
        margin-right: 8px;
        margin-bottom: 0 !important;
    }
    .date-cell-view {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
        width: 100%;
        white-space: nowrap !important;
    }

    .date-cell-edit {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        width: auto !important;
        min-width: 120px;
    }

    input.date-input-styled {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 42px !important; 
        text-align: left !important;
        padding: 0 10px !important;
        background-color: var(--bg-app);
        border: 1px solid var(--border);
        border-radius: 8px;
        -webkit-appearance: none;
        appearance: none;
    }

    .accounting-toggle-top {
        position: relative !important;
        top: auto !important;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 8px 0 8px 15px;
        margin-right: -5px;

        font-size: 0.9rem;
        font-weight: 500;
        color: var(--muted);
        cursor: pointer;
    }

        .accounting-toggle-top .bi {
            font-size: 1.2rem;
            margin-right: 6px;
        }
        .accounting-toggle-top .active-check {
            color: var(--primary);
            font-weight: 700;
        }

    input.date-input-styled {
        text-align: right !important;
        width: 140px !important;
        height: 44px !important;
        padding: 0 !important;
        margin-top: -4px;
        background: transparent !important;
        border: none !important;
        font-size: 1.1rem !important;
        color: var(--text);
        font-family: inherit;
        font-weight: normal !important;
        -webkit-appearance: none;
    }

        input.date-input-styled:focus {
            color: var(--primary);
            outline: none;
        }
    
    .budget-root {
        padding: 0.5rem;
    }

    .toolbar {
        padding: 1rem;
        gap: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

        .toolbar > .field:first-child {
            order: 1;
            width: 100%;
        }

        .search-field {
            order: 2 !important;
            width: 100%;
            margin-bottom: 0.5rem;
        }

        .toolbar-actions {
            order: 3;
            width: 100%;
            margin-left: 0;
            justify-content: center;
        }

            .toolbar-actions .btn {
                width: 100%;
                justify-content: center;
                padding: 12px;
            }
    .field input {
        max-width: 100% !important;
    }
        .hide-on-mobile {
            display: none !important;
        }

        .search-field {
            width: 100%;
            order: 2;
        }

        .styled-table thead {
            display: none;
        }

    .styled-table tbody tr {
        display: flex;
        flex-direction: column;
        background: var(--surface);
        margin-bottom: 20px;
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 16px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    }

    .styled-table td {
        border: none;
        padding: 10px 0;
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        width: 100% !important;
    }

            .styled-table td:first-child {
                font-weight: 800;
                font-size: 1.1rem;
                color: var(--primary);
                border-bottom: 2px solid #f0f0f0;
                margin-bottom: 5px;
                justify-content: flex-start;
            }

        .styled-table td:last-child {
            border-bottom: none;
            justify-content: flex-end;
            padding-top: 15px;
        }

            .styled-table td::before {
                content: attr(data-label);
                font-size: 0.75rem;
                color: #64748b;
                font-weight: 700;
                text-transform: uppercase;
                margin-right: auto;
                padding-right: 10px;
            }

            .styled-table td:first-child::before {
                display: none;
            }

            .styled-table td input, .styled-table td select, .styled-table td .cell-text {
                text-align: right;
                font-size: 1rem;
                max-width: 60%;
            }

            .styled-table td:first-child input, .styled-table td:first-child .cell-text {
                text-align: left !important;
                max-width: 100%;
            }

        .internal-cell {
            justify-content: flex-end;
        }

            .internal-cell input[type="checkbox"] {
                width: 24px;
                height: 24px;
                flex: 0 0 auto;
            }

        .name-cell-content {
            align-items: flex-start;
            width: 100%;
        }

        .created-by-badge {
            font-size: 0.65rem;
        }

        .num {
            text-align: right;
        }

        .styled-table::after {
            display: none;
        }

        .card-footer {
            flex-direction: column-reverse;
            align-items: stretch;
            gap: 15px;
        }

            .card-footer > *:first-child {
                margin-right: 0;
            }

            .card-footer .total {
                display: flex;
                flex-direction: column !important;
                align-items: flex-end;
                gap: 5px;
                width: 100%;
                padding: 10px 0;
                border-bottom: 1px dashed #e2e8f0;
            }

                .card-footer .total span {
                    display: flex;
                    justify-content: space-between;
                    width: 100%;
                    max-width: 300px;
                }

                .card-footer .total strong {
                    font-size: 1.1rem;
                }

            .card-footer .btn {
                width: 100%;
                justify-content: center;
            }

        td[data-label="Kategori"] select {
            max-width: 100% !important;
            text-align: left;
        }

        .category-badge {
            font-size: 0.8rem;
        }

    .tabs-container-wrapper {
        position: relative;
        max-width: 1000px;
        margin: 0 auto;
    }

    .fade-overlay {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, var(--bg-app));
        pointer-events: none;
        z-index: 5;
    }
    }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
    padding: 20px;
}

    .modal-overlay .card {
        max-height: 90vh;
        overflow-y: auto;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

    .suggestion-item:last-child {
        border-bottom: none;
    }

    .suggestion-item:hover {
        background-color: var(--bg-app);
        color: var(--primary);
    }

/* FAB (FLOATING ACTION BUTTONS */

.budget-root, section.card {
    padding-bottom: 100px !important;
}

.fab-action-btn {
    position: fixed;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s, opacity 0.3s, visibility 0.3s;
    z-index: 1000;
}

    .fab-action-btn:active {
        transform: scale(0.90);
    }

.btn-add {
    bottom: 30px;
    background-color: var(--primary);
    color: white;
}

    .btn-add:hover {
        background-color: #163a5f;
        transform: translateY(-3px);
    }

.btn-scroll {
    bottom: 100px;
    background-color: var(--surface);
    color: var(--primary);
    border: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

    .btn-scroll.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .btn-scroll:hover {
        background-color: var(--bg-app);
        border-color: var(--primary);
    }

@media (max-width: 768px) {

    .fab-action-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        right: 15px;
    }

    .btn-add {
        bottom: 90px !important;
    }

    .btn-scroll {
        bottom: 155px !important;
    }
}

/* widescreen fab buttons 1200px */
@media (min-width: 1200px) {
    .fab-action-btn {
        left: 50%;
        margin-left: 560px;
        right: auto;
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .btn-scroll {
        bottom: 95px;
    }

    .btn-add {
        bottom: 30px;
    }
}

.undo-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    letter-spacing: 0.5px;
}

    .undo-btn:hover {
        background: rgba(255,255,255,0.3);
    }

.date-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.date-input-styled {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    background: var(--bg-app);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    height: 36px;
}

.btn-next-month {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .btn-next-month:hover {
        background: var(--bg-app);
        color: var(--text);
        border-color: var(--primary);
    }

    .btn-next-month.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

.custom-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

    .custom-check input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        height: 0;
        width: 0;
    }

    .custom-check label {
        color: var(--muted);
        font-size: 1.2rem;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        cursor: pointer;
        margin: 0;
    }

    .custom-check input[type="checkbox"]:checked + label {
        color: var(--primary);
        transform: scale(1.1);
    }

        .custom-check input[type="checkbox"]:checked + label i {
            color: var(--primary);
        }

    .custom-check:hover label {
        color: var(--text);
        background-color: rgba(0,0,0,0.05);
        border-radius: 50%;
    }

[data-theme="dark"] .date-input-styled::-webkit-calendar-picker-indicator {
    filter: invert(1) !important;
    opacity: 1 !important;
    cursor: pointer;
}
.btn-icon-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    margin-right: 5px;
    transition: all 0.2s;
}

    .btn-icon-toggle.active {
        background-color: #dbeafe;
        color: #2563eb;
        border-color: #2563eb;
    }

[data-theme="dark"] .btn-icon-toggle.active {
    background-color: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
    border-color: #60a5fa;
}

.sub-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 768px) {
    .sub-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.sub-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .sub-input-group label {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--muted);
    }

.btn-full {
    width: 100%;
    padding: 14px;
    font-weight: 700;
    margin-top: 12px;
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
    -webkit-appearance: none
}

    .btn-full i, .btn-full span {
        color: #ffffff !important;
    }

.subscription-item-card {
    padding: 16px;
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    margin-bottom: 10px;
    border-left: 4px solid var(--primary);
}

[data-theme="dark"] .subscription-item-card {
    background: var(--surface);
    border-color: var(--primary);
}

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

.btn-full:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.swipe-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border-radius: 12px;
    margin-bottom: 10px;
    background: var(--debt);
}

    .swipe-container::-webkit-scrollbar {
        display: none;
    }

.swipe-content {
    flex: 0 0 100%;
    scroll-snap-align: start;
    background: var(--surface);
    padding: 16px;
    z-index: 2;
    position: relative
}

    .swipe-action {
        flex: 0 0 80px;
        scroll-snap-align: end;
        background: var(--debt);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        cursor: pointer;
    }

.sub-indicator {
    font-size: 0.75rem;
    margin-top: 8px;
    color: var(--muted);
    background: var(--bg-app);
    padding: 4px 8px;
    border-radius: 8px;
    display: inline-block;
    border-left: 3px solid var(--primary);
}

/* Container til redigering af dato */
.date-edit-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 140px;
}

/* Wrapper til selve input-feltet */
.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 8px;
    transition: border-color 0.2s;
}

    .date-input-wrapper:focus-within {
        border-color: var(--primary);
    }

.calendar-icon {
    font-size: 0.9rem;
    color: var(--muted);
    margin-right: 4px;
}

.compact-date-input {
    border: none !important;
    background: transparent !important;
    padding: 6px 0 !important;
    font-size: 0.85rem !important;
    color: var(--text);
    width: 100%;
    outline: none;
    cursor: pointer;
}

.btn-move-next {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background-color: var(--income-tint);
    color: var(--income);
    border: 1px solid transparent;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

    .btn-move-next:hover {
        background-color: var(--income);
        color: white;
    }

    .btn-move-next i {
        font-size: 1.1rem;
    }

@media (max-width: 600px) {
    .date-edit-container {
        flex-direction: row;
        justify-content: space-between;
    }

    .btn-move-next .btn-text {
        display: none; 
    }

    .btn-move-next {
        padding: 5px 8px;
    }
}

@media (min-width: 601px) {
    .date-edit-container {
        max-width: 220px;
    }
}

.date-edit-flex-container {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

@media (min-width: 769px) {
    .date-edit-cell {
        min-width: 280px !important;
    }

    .date-edit-flex-container {
        flex-wrap: nowrap;
    }
}

.date-input-styled-wrapper,
.btn-move-responsive {
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.date-input-styled-wrapper {
    background: var(--bg-app);
    border: 1px solid var(--border);
    padding: 0 10px;
    flex: 2; 
    min-width: 160px;
    cursor: pointer;
}

    .date-input-styled-wrapper i {
        margin-right: 8px;
        color: var(--primary);
        flex-shrink: 0;
    }

.date-input-control {
    border: none !important;
    background: transparent !important;
    font-size: 0.9rem !important;
    color: var(--text) !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    outline: none;
    cursor: pointer;
    min-width: 110px;
}

.btn-move-responsive {
    background-color: var(--income-tint);
    color: var(--income);
    border: 1px solid var(--income);
    padding: 0 12px;
    flex: 1;
    justify-content: center;
    white-space: nowrap;
    cursor: pointer;
}

    .btn-move-responsive:hover {
        background-color: var(--income);
        color: white;
    }

    .btn-move-responsive i {
        font-size: 1.3rem;
    }

.move-label {
    font-size: 0.85rem;
    font-weight: 700;
    margin-left: 4px;
}

@media (min-width: 769px) {
    .date-edit-cell {
        min-width: 340px !important;
    }

    .date-edit-flex-container {
        flex-wrap: nowrap; 
        max-width: 340px;
    }

    .btn-move-responsive {
        flex: 0 0 auto;
        min-width: 130px;
    }
}

@media (max-width: 768px) {
    .styled-table tbody tr {
        max-width: calc(100vw - 20px) !important;
    }

    .date-edit-flex-container {
        flex-direction: row;
    }

    @media (max-width: 400px) {
        .date-edit-flex-container {
            flex-direction: column;
            align-items: stretch;
            height: auto;
        }

        .date-input-styled-wrapper, .btn-move-responsive {
            width: 100%;
        }
    }
}