.baykat-finance-page,
.baykat-finance-login {
    --baykat-finance-ink: #302b25;
    --baykat-finance-muted: #777168;
    --baykat-finance-border: #e9e4dc;
    --baykat-finance-sand: #f7f4ee;
    --baykat-finance-gold: #b99a64;
    --baykat-finance-gold-dark: #947747;
    --baykat-finance-green: #327153;
    --baykat-finance-red: #a94e47;
}

.baykat-finance-page {
    box-sizing: border-box;
    width: min(100% - 40px, 1160px);
    margin: 48px auto 64px;
    color: var(--baykat-finance-ink);
    font-family: inherit;
    line-height: 1.55;
}

.baykat-finance-page *,
.baykat-finance-page *::before,
.baykat-finance-page *::after {
    box-sizing: border-box;
}

.baykat-finance-page h1,
.baykat-finance-page h2,
.baykat-finance-page p {
    margin-top: 0;
}

.baykat-finance-header {
    max-width: 760px;
    margin-bottom: 32px;
}

.baykat-finance-header h1 {
    margin-bottom: 10px;
    color: var(--baykat-finance-ink);
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.baykat-finance-header p {
    margin-bottom: 0;
    color: var(--baykat-finance-muted);
    font-size: 16px;
}

.baykat-finance-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

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

.baykat-finance-card {
    position: relative;
    min-width: 0;
    padding: 24px 26px;
    overflow: hidden;
    border: 1px solid var(--baykat-finance-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(48, 43, 37, 0.045);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.baykat-finance-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--baykat-finance-gold);
    content: "";
}

.baykat-finance-card-income::before {
    background: var(--baykat-finance-green);
}

.baykat-finance-card-expense::before {
    background: #c47b61;
}

.baykat-finance-card:hover {
    transform: translateY(-2px);
    border-color: #d9c9a8;
    box-shadow: 0 10px 26px rgba(48, 43, 37, 0.08);
}

.baykat-finance-card-label {
    display: block;
    margin-bottom: 10px;
    color: var(--baykat-finance-muted);
    font-size: 14px;
    font-weight: 600;
}

.baykat-finance-card-value {
    display: block;
    overflow-wrap: anywhere;
    color: var(--baykat-finance-ink);
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.baykat-finance-message {
    margin: 0 0 22px;
    padding: 14px 17px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
}

.baykat-finance-message-success {
    border-color: #d5e9dd;
    background: #f0f8f3;
    color: #245d3d;
}

.baykat-finance-message-error {
    border-color: #efd7d4;
    background: #fff5f3;
    color: #8f3832;
}

.baykat-finance-form,
.baykat-finance-transactions {
    padding: 30px;
    border: 1px solid var(--baykat-finance-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 22px rgba(48, 43, 37, 0.04);
}

.baykat-finance-form {
    margin-bottom: 24px;
}

.baykat-finance-section-heading {
    margin-bottom: 22px;
}

.baykat-finance-section-heading h2 {
    margin: 0 0 6px;
    color: var(--baykat-finance-ink);
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.baykat-finance-section-heading p {
    margin: 0;
    color: var(--baykat-finance-muted);
    font-size: 14px;
}

.baykat-finance-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--baykat-finance-gold-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.baykat-finance-form-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.baykat-finance-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}

.baykat-finance-field-description {
    grid-column: 1 / -1;
}

.baykat-finance-field label,
.baykat-finance-tool label {
    color: var(--baykat-finance-ink);
    font-size: 13px;
    font-weight: 650;
}

.baykat-finance-field input,
.baykat-finance-field select,
.baykat-finance-field textarea,
.baykat-finance-tool input,
.baykat-finance-tool select {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid #ded8ce;
    border-radius: 9px;
    background-color: #fff;
    color: var(--baykat-finance-ink);
    font: inherit;
    font-size: 15px;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.baykat-finance-field textarea {
    min-height: 104px;
    resize: vertical;
}

.baykat-finance-field input::placeholder,
.baykat-finance-field textarea::placeholder,
.baykat-finance-tool input::placeholder {
    color: #a19b91;
    opacity: 1;
}

.baykat-finance-field input:focus,
.baykat-finance-field select:focus,
.baykat-finance-field textarea:focus,
.baykat-finance-tool input:focus,
.baykat-finance-tool select:focus {
    border-color: var(--baykat-finance-gold);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(185, 154, 100, 0.18);
}

.baykat-finance-field input[aria-invalid="true"],
.baykat-finance-field input:focus:invalid {
    border-color: var(--baykat-finance-red);
    box-shadow: 0 0 0 3px rgba(169, 78, 71, 0.12);
}

.baykat-finance-field-help {
    color: var(--baykat-finance-muted);
    font-size: 12px;
}

.baykat-finance-button {
    display: inline-flex;
    min-height: 48px;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    justify-self: start;
    padding: 12px 22px;
    border: 1px solid var(--baykat-finance-gold-dark);
    border-radius: 9px;
    background: var(--baykat-finance-gold-dark);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.baykat-finance-button:hover {
    transform: translateY(-1px);
    border-color: #6b522f;
    background: #6b522f;
    color: #fff;
}

.baykat-finance-button:focus-visible {
    outline: 3px solid rgba(185, 154, 100, 0.35);
    outline-offset: 3px;
}

.baykat-finance-button:disabled {
    transform: none;
    border-color: #c7c1b7;
    background: #c7c1b7;
    box-shadow: none;
    cursor: wait;
}

.baykat-finance-transactions-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.baykat-finance-tools {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.55fr);
    gap: 14px;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid #eee9e1;
    border-radius: 12px;
    background: var(--baykat-finance-sand);
}

.baykat-finance-tool {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.baykat-finance-tool input,
.baykat-finance-tool select {
    min-height: 44px;
    background-color: #fff;
    font-size: 14px;
}

.baykat-finance-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--baykat-finance-border);
    border-radius: 10px;
    overscroll-behavior-x: contain;
}

.baykat-finance-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    background: #fff;
}

.baykat-finance-item-page .baykat-finance-table {
    min-width: 780px;
}

.baykat-finance-table tr[hidden] {
    display: none;
}

.baykat-finance-table th,
.baykat-finance-table td {
    padding: 15px 16px;
    border-bottom: 1px solid #efede9;
    text-align: left;
    vertical-align: middle;
}

.baykat-finance-table th {
    background: #faf8f4;
    color: var(--baykat-finance-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.baykat-finance-table td {
    color: var(--baykat-finance-ink);
    font-size: 14px;
}

.baykat-finance-table tbody tr:last-child td {
    border-bottom: 0;
}

.baykat-finance-transaction-row:hover {
    background: #fcfbf8;
}

.baykat-finance-type {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.baykat-finance-type-income {
    background: #edf6f0;
    color: var(--baykat-finance-green);
}

.baykat-finance-type-expense {
    background: #fbefed;
    color: var(--baykat-finance-red);
}

.baykat-finance-amount-cell {
    font-weight: 650;
    white-space: nowrap;
}

.baykat-finance-description-cell {
    min-width: 180px;
    overflow-wrap: anywhere;
}

.baykat-finance-empty-row td,
.baykat-finance-no-results td {
    padding: 28px 16px;
    color: var(--baykat-finance-muted);
    text-align: center;
}

.baykat-finance-login {
    width: min(100% - 40px, 720px);
    margin: 48px auto;
    padding: 26px;
    border: 1px solid var(--baykat-finance-border, #e9e4dc);
    border-radius: 14px;
    background: #fff;
    color: var(--baykat-finance-ink, #302b25);
}

.baykat-finance-login,
.baykat-finance-login * {
    box-sizing: border-box;
}

.baykat-finance-login p {
    margin: 0 0 16px;
}

@media (max-width: 760px) {
    .baykat-finance-page {
        width: min(100% - 32px, 620px);
        margin: 32px auto 44px;
    }

    .baykat-finance-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .baykat-finance-card {
        padding: 20px 22px;
    }

    .baykat-finance-card-value {
        font-size: 27px;
    }

    .baykat-finance-form,
    .baykat-finance-transactions {
        padding: 22px;
    }
}

@media (max-width: 540px) {
    .baykat-finance-page {
        width: min(100% - 24px, 480px);
        margin-top: 24px;
    }

    .baykat-finance-header {
        margin-bottom: 24px;
    }

    .baykat-finance-header h1 {
        font-size: 30px;
    }

    .baykat-finance-header p {
        font-size: 15px;
    }

    .baykat-finance-form,
    .baykat-finance-transactions {
        padding: 18px;
        border-radius: 13px;
    }

    .baykat-finance-form-content,
    .baykat-finance-tools {
        grid-template-columns: minmax(0, 1fr);
    }

    .baykat-finance-field-description,
    .baykat-finance-button {
        grid-column: auto;
    }

    .baykat-finance-button {
        width: 100%;
        justify-self: stretch;
    }

    .baykat-finance-table {
        min-width: 590px;
    }

    .baykat-finance-login {
        width: calc(100% - 24px);
        margin: 28px auto;
    }

    .baykat-finance-login .baykat-finance-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .baykat-finance-page *,
    .baykat-finance-page *::before,
    .baykat-finance-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
