html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

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

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    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;
    opacity: 0.4;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, 'Loading');
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ===========================================
   CSS Custom Properties
   =========================================== */
:root {
    --color-primary: #512BD4;
    --color-primary-dark: #3b1fa0;
    --color-sidebar-bg: #1e1e2d;
    --color-sidebar-text: #b0b0c0;
    --color-topbar-height: 56px;
    --sidebar-width: 240px;
}

/* ===========================================
   Layout
   =========================================== */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

.layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ===========================================
   Top Bar
   =========================================== */
.top-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: var(--color-topbar-height);
    padding: 0 1rem;
    background: var(--color-primary);
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 300;
    flex-shrink: 0;
}

.app-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    letter-spacing: 0.03em;
}

.app-brand:hover {
    color: rgba(255, 255, 255, 0.85);
}

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 7px 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 2px;
}

.top-bar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-display-name {
    font-size: 0.875rem;
    opacity: 0.9;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    padding: 0.35rem 0.85rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-signin {
    padding: 0.35rem 0.85rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    background: white;
    border: none;
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-signin:hover {
    background: #f0eaff;
}

/* ===========================================
   Layout Body
   =========================================== */
.layout-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===========================================
   Sidebar
   =========================================== */
.sidebar {
    width: 0;
    background: var(--color-sidebar-bg);
    color: var(--color-sidebar-text);
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    transition: width 0.3s ease;
}

.sidebar.sidebar-open {
    width: var(--sidebar-width);
}

.sidebar-backdrop {
    display: none;
}

/* ===========================================
   Main Content
   =========================================== */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: #f8f8fb;
}

.content-area {
    padding: 1.5rem;
    max-width: 1280px;
}

/* ===========================================
   Navigation Menu
   =========================================== */
.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    min-width: var(--sidebar-width);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--color-sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.nav-item.active {
    background: rgba(81, 43, 212, 0.3);
    color: #ffffff;
    border-left-color: var(--color-primary);
}

.nav-icon {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===========================================
   Login Page
   =========================================== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
}

.login-logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 0.375rem;
}

.login-subtitle {
    color: #666;
    margin: 0 0 2rem;
    font-size: 0.9rem;
}

.btn-microsoft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: #0078d4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-microsoft:hover {
    background: #006bbf;
}

.ms-logo {
    font-size: 1.1rem;
}

/* ===========================================
   Responsive – Mobile (≤ 768px)
   =========================================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: var(--color-topbar-height);
        height: calc(100vh - var(--color-topbar-height));
        height: calc(100dvh - var(--color-topbar-height));
        width: var(--sidebar-width) !important;
        z-index: 250;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: var(--color-topbar-height) 0 0 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 249;
    }

    .main-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .user-display-name {
        display: none;
    }
}

/* ===========================================
   Page Header
   =========================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-header__left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e1e2d;
    margin: 0;
}

.btn-back {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-back:hover {
    background: rgba(81, 43, 212, 0.1);
}

/* ===========================================
   Buttons
   =========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--color-primary);
    color: white;
}

.btn--primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
    box-shadow: 0 2px 8px rgba(81, 43, 212, 0.35);
}

.btn--secondary {
    background: #e8e8ef;
    color: #1e1e2d;
}

.btn--secondary:hover:not(:disabled) {
    background: #d8d8e2;
}

.btn--danger {
    background: #dc3545;
    color: white;
}

.btn--danger:hover:not(:disabled) {
    background: #c82333;
}

.btn--icon {
    padding: 0.4rem;
    min-width: 32px;
    min-height: 32px;
}

.btn--small,
.btn--sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* ===========================================
   Forms
   =========================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-group--inline {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group--checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #444;
    margin-bottom: 0.25rem;
    display: block;
}

.form-label--inline {
    font-size: 0.875rem;
    color: #444;
    margin: 0;
    cursor: pointer;
}

.form-input {
    width: 100%;
    padding: 0.65rem 0.875rem;
    font-size: 0.9rem;
    border: 1px solid #d0d0d8;
    border-radius: 6px;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(81, 43, 212, 0.12);
}

.form-input--narrow {
    max-width: 200px;
}

/* Custom date input */
.date-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.date-input {
    padding-right: 2.5rem;
}

.date-input__native {
    position: absolute;
    right: 0;
    top: 0;
    width: 2.5rem;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.date-input__native::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.form-actions--left {
    justify-content: flex-start;
}

.form-error {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.form-hint {
    color: #666;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.required {
    color: #dc3545;
}

/* ===========================================
   Cards & Containers
   =========================================== */
.detail-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.detail-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem 2rem;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-field dt {
    font-size: 0.8rem;
    color: #888;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.detail-field dd {
    font-size: 1rem;
    color: #1e1e2d;
    margin: 0;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e1e2d;
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
}

.section-title:first-child {
    margin-top: 0;
}

/* ===========================================
   Filter Bar
   =========================================== */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.filter-bar .form-group--inline {
    min-width: 120px;
}

.filter-bar__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #444;
    cursor: pointer;
}

.filter-bar__toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* ===========================================
   Accounts
   =========================================== */
.accounts-group {
    margin-bottom: 2rem;
}

.accounts-group__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.accounts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.account-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.1s;
}

.account-card:hover,
.account-card:focus {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    outline: none;
}

.account-card--clickable {
    cursor: pointer;
}

.account-card__info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.account-card__name {
    font-weight: 600;
    color: #1e1e2d;
}

.account-card__desc {
    font-size: 0.85rem;
    color: #888;
}

.account-card__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.account-card__currency {
    font-size: 0.8rem;
    font-weight: 500;
    color: #888;
    background: #f0f0f5;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.account-card__balance {
    font-size: 1.1rem;
    font-weight: 600;
}

.account-card__balance--positive {
    color: #28a745;
}

.account-card__balance--negative {
    color: #dc3545;
}

.account-card__chevron {
    color: #ccc;
    font-size: 1.25rem;
}

/* ===========================================
   Budgets & Progress Bars
   =========================================== */
.budget-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.budget-item {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.budget-item--clickable {
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.budget-item--clickable:hover,
.budget-item--clickable:focus {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    outline: none;
}

.budget-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.budget-item__category,
.budget-item__name {
    font-weight: 600;
    color: #1e1e2d;
}

.budget-item__desc {
    font-size: 0.85rem;
    color: #888;
    margin-left: 0.5rem;
}

.budget-item__amounts {
    font-size: 0.9rem;
    color: #666;
}

.budget-item__spent {
    font-weight: 600;
    color: #1e1e2d;
}

.budget-item__separator {
    color: #ccc;
}

.budget-item__limit {
    color: #888;
}

.budget-item__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.budget-item__remaining {
    font-size: 0.85rem;
    color: #666;
}

.budget-item__remaining--over {
    color: #dc3545;
    font-weight: 500;
}

.budget-item__pct {
    font-size: 0.85rem;
    color: #888;
}

.budget-bar-track {
    height: 8px;
    background: #e8e8ef;
    border-radius: 4px;
    overflow: hidden;
}

.budget-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.budget-bar--green {
    background: linear-gradient(90deg, #28a745, #34ce57);
}

.budget-bar--yellow {
    background: linear-gradient(90deg, #ffc107, #ffda44);
}

.budget-bar--red {
    background: linear-gradient(90deg, #dc3545, #e85a68);
}

.budget-bar__fill {
    height: 100%;
    border-radius: 4px;
}

.budget-bar__fill--ok {
    background: linear-gradient(90deg, #28a745, #34ce57);
}

.budget-bar__fill--warning {
    background: linear-gradient(90deg, #ffc107, #ffda44);
}

.budget-bar__fill--over {
    background: linear-gradient(90deg, #dc3545, #e85a68);
}

/* ===========================================
   Transactions
   =========================================== */
.tx-list {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    position: relative;
}

.tx-list--loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
    pointer-events: none;
}

.tx-list--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.5rem;
    height: 2.5rem;
    margin: -1.25rem 0 0 -1.25rem;
    border: 3px solid #e0e0e0;
    border-top-color: var(--color-primary, #512BD4);
    border-radius: 50%;
    animation: loading-spin 0.7s linear infinite;
    z-index: 11;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.tx-list__header {
    display: grid;
    grid-template-columns: 100px 1fr 120px;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: #f8f8fb;
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tx-list__header--4col {
    grid-template-columns: 100px 120px 1fr 120px;
}

.tx-list__amount-col {
    text-align: right;
}

.tx-item {
    display: grid;
    grid-template-columns: 100px 1fr 120px;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.tx-item--4col {
    grid-template-columns: 100px 120px 1fr 120px;
}

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

.tx-item--clickable {
    cursor: pointer;
    transition: background 0.15s;
}

.tx-item--clickable:hover {
    background: #f8f8fb;
}

.tx-item__date {
    font-size: 0.85rem;
    color: #666;
}

.tx-item__account {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-item__desc {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}

.tx-item__desc>span:first-child {
    font-weight: 500;
    color: #1e1e2d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-item__category {
    font-size: 0.8rem;
    color: #888;
}

.tx-item__amount {
    text-align: right;
    font-weight: 600;
}

.tx-item__amount small {
    font-weight: 400;
    color: #888;
    margin-left: 0.25rem;
}

.tx-item__amount--positive {
    color: #28a745;
}

.tx-item__amount--negative {
    color: #dc3545;
}

.tx-item--placeholder {
    pointer-events: none;
}

.skeleton-line {
    display: inline-block;
    height: 0.85em;
    width: 70%;
    background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-line--short {
    width: 40%;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.totals-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.totals-bar__label {
    font-size: 0.9rem;
    color: #666;
}

.totals-bar__sum {
    font-weight: 600;
    font-size: 1rem;
}

/* Transaction detail lines */
.tx-lines {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tx-line {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
    padding: 1rem;
    background: #f8f8fb;
    border-radius: 8px;
}

.tx-line .form-group {
    margin-bottom: 0;
}

.tx-lines-total {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.tx-lines-total strong {
    color: #1e1e2d;
}

/* ===========================================
   Dashboard
   =========================================== */
.dashboard {
    /* Container for dashboard page */
}

.dashboard-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-stats--row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-card--hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
}

.stat-card--hero .stat-card__label {
    color: rgba(255, 255, 255, 0.8);
}

.stat-card--hero .stat-card__value {
    color: white;
}

.stat-card__label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.stat-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e1e2d;
}

.stat-card__value--hero {
    font-size: 2.25rem;
}

.stat-card__value--positive {
    color: #28a745;
}

.stat-card__value--negative {
    color: #dc3545;
}

.dashboard-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.1s, box-shadow 0.2s;
}

.dashboard-alert:hover {
    transform: translateX(4px);
}

.dashboard-alert--warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.dashboard-alert--info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.dashboard-section {
    margin-bottom: 2rem;
}

/* ===========================================
   Tithe Summary
   =========================================== */
.tithe-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    background: white;
    padding: 1.25rem;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.tithe-summary__item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tithe-summary__label {
    font-size: 0.8rem;
    color: #888;
}

.tithe-summary__value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e1e2d;
}

.tithe-summary__value--available {
    color: var(--color-primary);
}

/* ===========================================
   Empty State
   =========================================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.empty-state p,
.empty-state__text {
    color: #888;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* ===========================================
   Modals
   =========================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal--narrow {
    max-width: 360px;
}

.modal__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e1e2d;
    margin: 0 0 1rem;
}

/* ===========================================
   Badges
   =========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    background: #e8e8ef;
    color: #666;
}

.badge--success {
    background: #d4edda;
    color: #155724;
}

.badge--info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge--warning {
    background: #fff3cd;
    color: #856404;
}

.badge--danger {
    background: #f8d7da;
    color: #721c24;
}

.badge--muted {
    background: #f0f0f5;
    color: #888;
}

/* ===========================================
   Row Actions
   =========================================== */
.row-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

/* ===========================================
   Loading & Errors
   =========================================== */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.error-display {
    color: #dc3545;
    background: #f8d7da;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.success-display {
    color: #155724;
    background: #d4edda;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.confirm-delete-prompt {
    font-size: 0.9rem;
    color: #dc3545;
    font-weight: 500;
}

/* ===========================================
   Alerts
   =========================================== */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert--success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

/* ===========================================
   Settings Page
   =========================================== */
.settings-section {
    margin-bottom: 1.5rem;
}

.settings-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.settings-user__avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: #f0f0f5;
    border-radius: 50%;
}

.settings-user__info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.settings-user__name {
    font-weight: 600;
    color: #1e1e2d;
}

.settings-user__email {
    font-size: 0.85rem;
    color: #888;
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: #f8f8fb;
    border-radius: 8px;
}

.settings-action__info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.settings-action__title {
    font-weight: 600;
    color: #1e1e2d;
}

.settings-action__desc {
    font-size: 0.85rem;
    color: #666;
}

.settings-about {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-about__row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.settings-about__row:last-child {
    border-bottom: none;
}

.settings-about__label {
    color: #888;
}

.settings-about__value {
    font-weight: 500;
    color: #1e1e2d;
}

.settings-saved-notice {
    color: #28a745;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* ===========================================
   Import Page
   =========================================== */
.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 120px;
    padding: 2rem;
    border: 2px dashed #d0d0d8;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
}

.drop-zone:hover {
    border-color: var(--color-primary);
    background: rgba(81, 43, 212, 0.04);
}

.drop-zone--active {
    border-color: var(--color-primary);
    background: rgba(81, 43, 212, 0.08);
}

.drop-zone__prompt {
    color: #888;
    font-size: 0.9rem;
}

.drop-zone__file-name {
    font-weight: 600;
    color: #1e1e2d;
}

.drop-zone__file-size {
    font-size: 0.85rem;
    color: #888;
}

.import-result {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.import-result--success {
    border-left: 4px solid #28a745;
}

.import-result--info {
    border-left: 4px solid #17a2b8;
}

.import-result__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e1e2d;
    margin: 0 0 1rem;
}

.import-result__stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.import-result__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.import-result__stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.import-result__stat-label {
    font-size: 0.85rem;
    color: #888;
}

/* ===========================================
   Reports Page
   =========================================== */
.report-section {
    margin-bottom: 2rem;
}

.ie-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: white;
    padding: 1.25rem;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.ie-chart__row {
    display: grid;
    grid-template-columns: 80px 1fr 100px;
    gap: 1rem;
    align-items: center;
}

.ie-chart__label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
}

.ie-chart__track {
    height: 24px;
    background: #e8e8ef;
    border-radius: 6px;
    overflow: hidden;
}

.ie-chart__bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.ie-chart__bar--income {
    background: linear-gradient(90deg, #28a745, #34ce57);
}

.ie-chart__bar--expense {
    background: linear-gradient(90deg, #dc3545, #e85a68);
}

.ie-chart__value {
    font-weight: 600;
    text-align: right;
}

.cat-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: white;
    padding: 1.25rem;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.cat-breakdown__item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cat-breakdown__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cat-breakdown__dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.cat-breakdown__name {
    flex: 1;
    font-weight: 500;
    color: #1e1e2d;
}

.cat-breakdown__pct {
    font-size: 0.85rem;
    color: #888;
    min-width: 48px;
    text-align: right;
}

.cat-breakdown__amount {
    font-weight: 600;
    color: #1e1e2d;
    min-width: 80px;
    text-align: right;
}

.trend-chart {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 120px;
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
}

.trend-chart__col {
    flex: 1;
    min-width: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.trend-chart__bars {
    flex: 1;
    display: flex;
    gap: 1px;
    align-items: flex-end;
    width: 100%;
}

.trend-chart__bar {
    flex: 1;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
}

.trend-chart__bar--income {
    background: #28a745;
}

.trend-chart__bar--expense {
    background: #dc3545;
}

.trend-chart__label {
    font-size: 0.65rem;
    color: #888;
    margin-top: 4px;
}

/* ===========================================
   Data Tables
   =========================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.625rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    font-weight: 600;
    color: #666;
    background: #f8f8fb;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.text-right {
    text-align: right !important;
}

/* ===========================================
   Receipt Detail
   =========================================== */
.receipt-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .receipt-layout {
        grid-template-columns: 1fr;
    }
}

.receipt-image-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.receipt-image {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.receipt-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #f0f0f5;
    color: #888;
}

.receipt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.receipt-meta__filename {
    font-size: 0.85rem;
    color: #666;
}

.receipt-meta__date {
    font-size: 0.8rem;
    color: #888;
}

.receipt-data-panel {
    /* Content panel */
}

/* ===========================================
   Category Tree
   =========================================== */
.category-tree {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ===========================================
   Text Utilities
   =========================================== */
.text--warning {
    color: #ffc107;
}

.amount--positive {
    color: #28a745;
}

.amount--negative {
    color: #dc3545;
}

/* ===========================================
   Category Tree Node
   =========================================== */
.category-node {
    padding-left: 0;
}

.category-node__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}

.category-node__row:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-node__icon {
    font-size: 0.75rem;
}

.category-node__name {
    flex: 1;
    font-weight: 500;
    color: #1e1e2d;
}

.category-node__actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.category-node__row:hover .category-node__actions {
    opacity: 1;
}

.category-node__children {
    padding-left: 1.5rem;
    border-left: 2px solid #e8e8ef;
    margin-left: 0.5rem;
}

.badge--system {
    background: #e0d4f7;
    color: var(--color-primary);
    font-size: 0.7rem;
}

/* ===========================================
   Confirm Dialog
   =========================================== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.confirm-dialog {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.confirm-dialog__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e1e2d;
    margin: 0 0 0.75rem;
}

.confirm-dialog__message {
    color: #666;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.confirm-dialog__actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

/* ===========================================
   Mobile Responsive
   =========================================== */
@media (max-width: 640px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header__left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .tx-list__header,
    .tx-list__header--4col,
    .tx-item,
    .tx-item--4col {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .tx-list__header,
    .tx-list__header--4col {
        display: none;
    }

    .tx-item__account {
        font-size: 0.8rem;
        color: #888;
    }

    .tx-item__account::before {
        content: "Account: ";
        color: #aaa;
    }

    .tx-item__amount {
        text-align: left;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .tx-line {
        grid-template-columns: 1fr;
    }

    .stat-card__value {
        font-size: 1.5rem;
    }

    .stat-card__value--hero {
        font-size: 1.75rem;
    }

    .dashboard-stats--row {
        grid-template-columns: 1fr;
    }

    .ie-chart__row {
        grid-template-columns: 60px 1fr;
    }

    .ie-chart__value {
        grid-column: span 2;
        text-align: left;
        margin-top: 0.25rem;
    }

    .category-node__actions {
        opacity: 1;
    }
}