:root {
    --table-card-border-radius: 0.75rem;
    --table-card-shadow: 0 0.125rem 0.5rem rgba(15, 23, 42, 0.1);
    --table-header-bg: #f8f9fa;
    --table-hover-bg: rgba(13, 110, 253, 0.08);
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.table-toolbar .toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.table-sticky thead th {
    position: sticky;
    top: 0;
    background-color: var(--table-header-bg);
    z-index: 2;
}

.table-zebra tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background-color: var(--table-hover-bg);
}

.table-card tbody tr {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.table-card tbody tr:hover {
    box-shadow: var(--table-card-shadow);
    transform: translateY(-2px);
}

.table-card tbody tr td {
    vertical-align: middle;
}

.badge-soft {
    background-color: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.badge-soft-success {
    background-color: rgba(25, 135, 84, 0.12);
    color: #198754;
}

.badge-soft-danger {
    background-color: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.table-responsive-card {
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .table-responsive-card table {
        border: none;
    }

    .table-responsive-card thead {
        display: none;
    }

    .table-responsive-card tbody tr {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
        border-radius: var(--table-card-border-radius);
        padding: 1rem;
        margin-bottom: 1rem;
        background-color: #ffffff;
        box-shadow: var(--table-card-shadow);
    }

    .table-responsive-card tbody td {
        display: grid;
        grid-template-columns: minmax(120px, 40%) 1fr;
        align-items: center;
        gap: 0.5rem;
        padding: 0;
        border: none;
    }

    .table-responsive-card tbody td.text-end {
        text-align: left;
    }

    .table-responsive-card tbody td.text-end > span {
        justify-self: end;
        text-align: right;
    }

    .table-responsive-card tbody td.d-none,
    .table-responsive-card tbody td.d-md-table-cell {
        display: grid !important;
    }

    .table-responsive-card tbody td.table-card-mobile-hidden {
        display: none !important;
    }

    .table-responsive-card tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: #6c757d;
    }

    .table-responsive-card tbody td .btn,
    .table-responsive-card tbody td a {
        width: fit-content;
    }

    .table-responsive-card tbody td.table-card-actions {
        grid-template-columns: auto;
    }

    .table-responsive-card tbody td.table-card-actions::before {
        display: none;
    }

    .table-responsive-card tbody td.table-card-actions .dropdown,
    .table-responsive-card tbody td.table-card-actions .table-action-buttons {
        justify-self: end;
    }

    .table-responsive-card tbody td.table-card-actions .table-action-buttons {
        display: inline-flex;
    }

    .table-responsive-card .category-tree tbody tr {
        display: table-row;
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin-bottom: 0;
    }

    .table-responsive-card .category-tree tbody td {
        display: table-cell;
        padding: 0.75rem;
        border: none;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    }

    .table-responsive-card .category-tree tbody tr:last-child td {
        border-bottom: none;
    }

    .table-responsive-card .category-tree tbody td::before {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .transactions-table-wrapper table {
        width: 100%;
    }

    .transactions-table-wrapper thead {
        display: none;
    }

    .transactions-table-wrapper tbody tr {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.5rem 0;
        margin: 0;
        border-bottom: 1px solid rgba(15, 23, 42, 0.1);
        border-radius: 0;
        background-color: transparent;
        box-shadow: none;
    }

    .transactions-table-wrapper tbody tr:hover {
        transform: none;
    }

    .transactions-table-wrapper tbody tr:last-child {
        border-bottom: none;
    }

    .transactions-table-wrapper tbody td {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0;
        border: none;
        font-size: 0.95rem;
        white-space: nowrap;
    }

    .transactions-table-wrapper tbody td::before {
        display: none;
    }

    .transactions-table-wrapper tbody td.transactions-table-category {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .transactions-table-wrapper tbody td.transactions-table-amount {
        font-weight: 600;
    }

    .transactions-table-wrapper tbody td.table-card-actions {
        margin-left: auto;
    }

    .transactions-table-wrapper tbody td.table-card-actions .table-action-buttons {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
    }

    .transactions-table-wrapper tbody td.table-card-actions .btn {
        padding: 0.25rem 0.5rem;
        line-height: 1.1;
    }

    .transactions-table-wrapper tbody td.table-card-actions .btn .bi {
        font-size: 1.1rem;
    }
}

.category-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.category-node {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1 1 auto;
    min-width: 0;
}

.category-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    box-shadow: 0 0.35rem 0.8rem rgba(15, 23, 42, 0.18);
}

.category-node a {
    font-weight: 600;
    color: inherit;
}

.category-node a:hover,
.category-node a:focus {
    color: #0d6efd;
}

.category-row .create-subcategory {
    white-space: nowrap;
}

.category-row .indenter {
    margin-right: 0.35rem;
    flex-shrink: 0;
}

.category-row .indenter a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    color: inherit;
}

.category-row .indenter a:hover,
.category-row .indenter a:focus {
    background-color: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
}

.table-action-buttons {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background-color: #ffffff;
    color: #6c757d;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-icon:hover,
.btn-icon:focus {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    border-color: rgba(13, 110, 253, 0.3);
}

.budget-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.85), rgba(13, 110, 253, 0.65));
    color: #ffffff;
    box-shadow: 0 0.35rem 0.8rem rgba(15, 23, 42, 0.18);
    font-size: 1.1rem;
}

.dropdown-menu .dropdown-item.danger {
    color: #dc3545;
}

.dropdown-menu .dropdown-item.danger:hover,
.dropdown-menu .dropdown-item.danger:focus {
    background-color: rgba(220, 53, 69, 0.12);
    color: #c82333;
}

.registration-card,
.auth-card,
.registration-success-card {
    border-radius: 1.25rem;
    box-shadow: var(--table-card-shadow);
    border: 1px solid rgba(15, 23, 42, 0.08);
    background-color: #ffffff;
}

.registration-title,
.auth-card-title {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
}

.registration-subtitle,
.auth-card-subtitle,
.registration-success-message {
    color: #64748b;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background-color: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.auth-card .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
    border-color: rgba(13, 110, 253, 0.45);
}

.auth-card-footer {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(13, 110, 253, 0.2));
    border-radius: 0 0 1.25rem 1.25rem;
}

.registration-success-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.85), rgba(13, 110, 253, 0.75));
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0.65rem 1.8rem rgba(15, 23, 42, 0.18);
}

.onboarding-modal .modal-content {
    border-radius: 1.5rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 1.25rem 3.5rem rgba(15, 23, 42, 0.18);
}

.onboarding-modal .modal-header,
.onboarding-modal .modal-footer {
    border: none;
    padding: 1.5rem 2rem;
}

.onboarding-modal .modal-body {
    padding: 0 2rem 2rem 2rem;
}

.onboarding-progress {
    height: 0.75rem;
    border-radius: 999px;
    background-color: rgba(148, 163, 184, 0.25);
}

.onboarding-progress .progress-bar {
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.9), rgba(13, 110, 253, 0.8));
}

.onboarding-template {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.85rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.onboarding-template:hover,
.onboarding-template:focus-within {
    background-color: rgba(13, 110, 253, 0.08);
}

.form-check-input:checked + .onboarding-template,
.onboarding-template.active {
    background-color: rgba(13, 110, 253, 0.14);
    box-shadow: 0 0.85rem 2rem rgba(13, 110, 253, 0.18);
    transform: translateY(-1px);
}

.template-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.2rem;
    box-shadow: 0 0.45rem 1.45rem rgba(15, 23, 42, 0.16);
}

.template-icon i {
    font-size: 1.1rem;
}

.onboarding-template-title {
    font-weight: 600;
}

.onboarding-template small {
    color: #64748b;
}

.icon-picker-dropdown .dropdown-menu {
    max-height: 320px;
    overflow-y: auto;
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(44px, 1fr));
    gap: 0.5rem;
}

.icon-picker-grid .icon-option {
    width: 44px;
    height: 44px;
    border-radius: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-picker-grid .icon-option:hover,
.icon-picker-grid .icon-option:focus {
    transform: translateY(-1px);
    box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.14);
}

.icon-picker-grid .icon-option.active {
    outline: 2px solid rgba(13, 110, 253, 0.65);
    box-shadow: 0 0.85rem 1.8rem rgba(13, 110, 253, 0.28);
}

.icon-picker-grid .icon-option i {
    font-size: 1.2rem;
    color: #ffffff;
}

.icon-preview-pill {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 0.45rem 1.45rem rgba(15, 23, 42, 0.16);
}

.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: radial-gradient(circle at 0% 0%, rgba(13, 110, 253, 0.08) 0%, transparent 55%),
        radial-gradient(circle at 100% 0%, rgba(15, 118, 110, 0.1) 0%, transparent 45%),
        #f8fafc;
}

.auth-shell {
    width: 100%;
    max-width: 520px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth-brand img {
    width: 40px;
    height: 40px;
}

.auth-brand span {
    font-weight: 700;
    color: #0f172a;
    font-size: 1.25rem;
}

.registration-success-card {
    padding: 3rem 2.5rem;
}

.registration-success-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.registration-success-actions .btn {
    flex: 1 1 auto;
}

.onboarding-body {
    background: radial-gradient(circle at 0% 0%, rgba(13, 110, 253, 0.12) 0%, transparent 55%),
        radial-gradient(circle at 100% 0%, rgba(15, 118, 110, 0.12) 0%, transparent 45%),
        #f8fafc;
    min-height: 100vh;
}

.onboarding-modal .wizard-step h3 {
    font-weight: 700;
    color: #0f172a;
}

.onboarding-modal .wizard-step p {
    color: #64748b;
}

.onboarding-action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.onboarding-action-bar .btn {
    min-width: 120px;
}

.onboarding-review-list {
    list-style: none;
    padding-left: 0;
}

.onboarding-review-list li::before {
    content: '•';
    color: #0d6efd;
    margin-right: 0.5rem;
}

.onboarding-step-card {
    background-color: #ffffff;
    border-radius: 1.25rem;
    box-shadow: var(--table-card-shadow);
    padding: 1.5rem;
}

.onboarding-step-card .form-check {
    margin-bottom: 0.75rem;
}
