﻿.finance-main {
    padding-bottom: 42px;
}

.finance-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.finance-heading-actions {
    display: flex;
    gap: 8px;
}

.finance-heading-actions a {
    padding: 10px 12px;
    border: 1px solid #d8e2ef;
    border-radius: 9px;
    color: #5a6c84;
    background: #fbfcff;
    font-size: 9px;
    font-weight: 900;
    text-decoration: none;
}

.finance-heading-actions a.primary {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(105deg, #237bcf, #7043d7);
}

.finance-heading + .definition-message,
.finance-heading ~ .definition-message {
    margin-top: 15px;
    margin-bottom: 0;
}

.cash-date-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 10px;
    border: 1px solid #dfe7f2;
    border-radius: 13px;
    background: #f8faff;
}

.cash-date-bar nav,
.cash-date-bar form {
    display: flex;
    align-items: center;
    gap: 7px;
}

.cash-date-bar nav a {
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #d8e2ee;
    border-radius: 9px;
    color: #526983;
    background: #fff;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.cash-date-bar nav a.today {
    padding: 0 12px;
    color: #6840c9;
    background: #f8f4ff;
    font-size: 9px;
}

.cash-date-bar nav a.disabled {
    pointer-events: none;
    opacity: .35;
}

.cash-date-bar label,
.finance-report-filter label,
.finance-search-form label {
    display: grid;
    gap: 4px;
    min-width: 118px;
}

.cash-date-bar label small,
.finance-report-filter label small,
.finance-search-form label small {
    color: #8491a5;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .65px;
}

.cash-date-bar input,
.cash-date-bar select,
.finance-report-filter input,
.finance-report-filter select,
.finance-search-form select {
    width: 100%;
    height: 34px;
    padding: 0 9px;
    border: 1px solid #d7e1ed;
    border-radius: 8px;
    outline: none;
    color: #40536e;
    background: #fff;
    font-size: 9px;
}

.finance-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.finance-kpis article {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e0e8f2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 12px rgba(42, 64, 98, .035);
}

.finance-kpis article > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 900;
}

.finance-kpis .income > span { color: #16865a; background: #e4f8ee; }
.finance-kpis .expense > span { color: #c03f53; background: #fff0f2; }
.finance-kpis .net > span { color: #1979c7; background: #e8f5ff; }
.finance-kpis .balance > span { color: #6b40cb; background: #f0ebff; }
.finance-kpis .net.negative > span { color: #c03f53; background: #fff0f2; }
.finance-kpis small,
.finance-kpis strong,
.finance-kpis em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-kpis small { color: #7f8da2; font-size: 8px; font-weight: 900; letter-spacing: .65px; }
.finance-kpis strong { margin-top: 3px; color: #263d5f; font-size: 16px; }
.finance-kpis em { margin-top: 3px; color: #8b97a8; font-size: 8px; font-style: normal; }

.cash-method-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(125px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.payment-method-card {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border: 1px solid #e1e8f2;
    border-radius: 11px;
    background: #fbfcff;
}

.payment-method-card > span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 9px;
    color: #6541bf;
    background: #f0ebff;
    font-size: 11px;
    font-weight: 900;
}

.payment-method-card small,
.payment-method-card strong,
.payment-method-card em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payment-method-card small { color: #75839a; font-size: 7px; font-weight: 900; }
.payment-method-card strong { margin-top: 3px; color: #324965; font-size: 10px; }
.payment-method-card em { margin-top: 2px; color: #909aaa; font-size: 6px; font-style: normal; }

.finance-toolbar,
.finance-report-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding: 10px;
    border: 1px solid #dee7f2;
    border-radius: 13px;
    background: #f8faff;
}

.finance-toolbar > div strong,
.finance-toolbar > div small { display: block; }
.finance-toolbar > div strong { font-size: 11px; }
.finance-toolbar > div small { margin-top: 3px; color: #8592a5; font-size: 8px; }
.finance-search-form,
.finance-report-filter { display: flex; align-items: flex-end; gap: 7px; min-width: 0; }
.finance-search { min-width: 270px !important; }
.finance-search > span {
    display: flex;
    align-items: center;
    height: 34px;
    padding-left: 8px;
    overflow: hidden;
    border: 1px solid #d7e1ed;
    border-radius: 8px;
    color: #8391a5;
    background: #fff;
}

.finance-search input {
    min-width: 0;
    flex: 1;
    height: 32px;
    padding: 0 7px;
    border: 0;
    outline: none;
    color: #40536e;
    background: transparent;
    font-size: 9px;
}

.finance-search button {
    align-self: stretch;
    min-width: 62px;
    padding: 0 8px;
    border: 0;
    color: #fff;
    background: #6f42d3;
    font-size: 8px;
    font-weight: 900;
}

.cash-workspace,
.income-expense-workspace {
    display: grid;
    grid-template-columns: 335px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    margin-top: 12px;
}

.cash-entry-panel,
.finance-entry-card {
    min-width: 0;
    padding: 15px;
    border: 1px solid #dfe7f1;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 5px 13px rgba(40, 62, 96, .04);
}

.finance-panel-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e7edf4;
}

.finance-panel-title > span {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(145deg, #2994de, #7043d7);
    font-size: 13px;
    font-weight: 900;
}

.finance-panel-title h2 { margin: 0; font-size: 14px; }
.finance-panel-title small { display: block; margin-top: 4px; color: #8491a4; font-size: 8px; line-height: 1.4; }

.finance-entry-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.finance-entry-form > label,
.finance-entry-form .finance-form-row label,
.finance-row-actions form label {
    display: grid;
    gap: 5px;
    color: #5f7087;
    font-size: 9px;
    font-weight: 800;
}

.finance-entry-form label em {
    color: #9ba5b4;
    font-size: 7px;
    font-style: normal;
    font-weight: 600;
}

.finance-entry-form input,
.finance-entry-form select,
.finance-entry-form textarea,
.finance-row-actions form textarea {
    width: 100%;
    min-width: 0;
    height: 37px;
    padding: 0 10px;
    border: 1px solid #d7e1ed;
    border-radius: 8px;
    outline: none;
    color: #3f526c;
    background: #fff;
    font-size: 9px;
}

.finance-entry-form textarea,
.finance-row-actions form textarea {
    min-height: 64px;
    padding-top: 9px;
    resize: vertical;
}

.finance-entry-form input:focus,
.finance-entry-form select:focus,
.finance-entry-form textarea:focus { border-color: #579fe0; box-shadow: 0 0 0 3px rgba(48, 143, 219, .1); }
.finance-entry-form label > span:not(.hotel-required-bubble) { color: #bf4657; font-size: 7px; font-weight: 600; }
.finance-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.finance-save-button,
.finance-refund-button {
    width: 100%;
    padding: 11px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(105deg, #1e83cf, #7042d8);
    font-size: 9px;
    font-weight: 900;
}

.finance-refund-button { background: linear-gradient(105deg, #b43f51, #d76b51); }

.cash-no-balance {
    display: grid;
    justify-items: center;
    padding: 25px 12px;
    text-align: center;
}

.cash-no-balance b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #16835a; background: #e5f8ee; }
.cash-no-balance strong { margin-top: 10px; font-size: 11px; }
.cash-no-balance span { margin-top: 5px; color: #8592a5; font-size: 8px; line-height: 1.5; }

.refund-panel {
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid #e7edf4;
}

.refund-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px;
    border: 1px solid #efd3d8;
    border-radius: 9px;
    color: #a44352;
    background: #fff7f8;
    font-size: 9px;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
}

.refund-panel > summary::-webkit-details-marker { display: none; }
.refund-panel > p { color: #7f8da1; font-size: 8px; line-height: 1.5; }

.finance-ledger {
    min-width: 0;
    border: 1px solid #dfe7f1;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 5px 13px rgba(40, 62, 96, .04);
    overflow: visible;
}

.finance-ledger-header,
.finance-ledger-row {
    display: grid;
    grid-template-columns: 118px 125px 110px minmax(175px, 1fr) 115px 35px;
    align-items: center;
    gap: 9px;
}

.finance-ledger-header {
    min-height: 40px;
    padding: 0 12px;
    border-bottom: 1px solid #dfe7f1;
    border-radius: 14px 14px 0 0;
    color: #8190a5;
    background: #f5f8fc;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .55px;
}

.finance-ledger-row {
    position: relative;
    min-height: 76px;
    padding: 11px 12px;
    border-bottom: 1px solid #e8edf4;
    border-left: 3px solid #2a9c6d;
}

.finance-ledger-row.expense { border-left-color: #d05263; }
.finance-ledger-row:last-child { border-bottom: 0; border-radius: 0 0 0 14px; }
.finance-ledger-row.voided { border-left-color: #a0a9b7; background: #f7f8fa; opacity: .7; }
.finance-ledger-row.voided:after { content: "\0130PTAL"; position: absolute; right: 46px; top: 7px; color: #a24e59; font-size: 6px; font-weight: 900; letter-spacing: .6px; }

.finance-transaction-id span,
.finance-transaction-id strong,
.finance-transaction-id small,
.finance-source strong,
.finance-source small,
.finance-method strong,
.finance-method small,
.finance-description strong,
.finance-description small,
.finance-amount strong,
.finance-amount small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-transaction-id span { color: #6d7d94; font-size: 8px; font-weight: 900; }
.finance-transaction-id strong { margin-top: 4px; color: #344b69; font-size: 8px; }
.finance-transaction-id small { margin-top: 3px; color: #929dad; font-size: 7px; }
.finance-type { display: inline-flex; padding: 3px 6px; border-radius: 6px; font-size: 7px; font-weight: 900; }
.finance-type.income { color: #16764f; background: #e5f8ee; }
.finance-type.expense { color: #b33e50; background: #fff0f2; }
.finance-source strong,
.finance-method strong,
.finance-description strong { margin-top: 4px; color: #3c526e; font-size: 8px; }
.finance-source small,
.finance-method small,
.finance-description small { margin-top: 4px; color: #8793a5; font-size: 7px; }
.finance-amount { text-align: right; }
.finance-amount strong { color: #188158; font-size: 10px; }
.finance-ledger-row.expense .finance-amount strong { color: #bd4053; }
.finance-ledger-row.voided .finance-amount strong { color: #788699; text-decoration: line-through; }
.finance-amount small { margin-top: 4px; color: #8b96a6; font-size: 7px; }

.finance-row-actions {
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.finance-row-actions details { position: relative; }
.finance-row-actions summary { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #d8e2ee; border-radius: 7px; color: #6650a7; background: #fafbfe; font-size: 14px; font-weight: 900; cursor: pointer; list-style: none; }
.finance-row-actions summary::-webkit-details-marker { display: none; }
.finance-row-actions form { position: absolute; z-index: 30; right: 0; top: 34px; width: 220px; padding: 11px; border: 1px solid #dce4ef; border-radius: 10px; background: #fff; box-shadow: 0 14px 30px rgba(28, 49, 81, .18); }
.finance-row-actions form button { width: 100%; margin-top: 8px; padding: 9px; border: 0; border-radius: 8px; color: #fff; background: #bb4355; font-size: 8px; font-weight: 900; }

.finance-empty {
    display: grid;
    justify-items: center;
    min-height: 340px;
    align-content: center;
    padding: 35px;
    text-align: center;
}

.finance-empty > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: #6840ca; background: #f0ebff; font-size: 17px; font-weight: 900; }
.finance-empty h2 { margin: 13px 0 0; font-size: 16px; }
.finance-empty p { max-width: 400px; margin: 7px 0 0; color: #7d8a9e; font-size: 9px; line-height: 1.5; }

.finance-report-toolbar { align-items: stretch; }
.finance-report-filter { width: 100%; }
.finance-report-filter label { min-width: 100px; flex: .8; }
.finance-report-filter .finance-search { flex: 1.5; }

.income-expense-workspace {
    grid-template-columns: 325px minmax(0, 1fr);
}

.finance-entry-card {
    position: sticky;
    top: 0;
}

.finance-type-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.finance-type-switch label { cursor: pointer; }
.finance-type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.finance-type-switch span { display: grid; place-items: center; height: 36px; border: 1px solid #d8e2ee; border-radius: 8px; color: #65768d; background: #f9fbfe; font-size: 9px; font-weight: 900; }
.finance-type-switch input[value="Income"] + span { border: 2px solid #20a76f; color: #087a4f; background: #e6f8f0; }
.finance-type-switch input[value="Expense"] + span { border: 2px solid #df5264; color: #b42338; background: #fff0f2; }
.finance-type-switch input[value="Income"]:checked + span { border-color: #087a4f; color: #fff; background: #0a8f5d; box-shadow: 0 5px 12px rgba(10, 143, 93, .22); }
.finance-type-switch input[value="Expense"]:checked + span { border-color: #b42338; color: #fff; background: #c92f45; box-shadow: 0 5px 12px rgba(201, 47, 69, .22); }

.finance-report-content {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.finance-breakdowns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.finance-breakdowns > article {
    min-width: 0;
    padding: 13px;
    border: 1px solid #dfe7f1;
    border-radius: 13px;
    background: #fff;
}

.finance-breakdowns article > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.finance-breakdowns header small,
.finance-breakdowns header strong { display: block; }
.finance-breakdowns header small { color: #8190a5; font-size: 7px; font-weight: 900; letter-spacing: .65px; }
.finance-breakdowns header strong { margin-top: 3px; font-size: 13px; }
.finance-breakdowns header > span { padding: 4px 6px; border-radius: 6px; font-size: 7px; font-weight: 900; }
.finance-breakdowns header > span.income { color: #16764f; background: #e5f8ee; }
.finance-breakdowns header > span.expense { color: #b33e50; background: #fff0f2; }
.finance-breakdowns article > p { margin: 14px 0 4px; color: #8793a5; font-size: 8px; }

.category-bars { display: grid; gap: 9px; margin-top: 12px; }
.category-bars > div > span { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.category-bars b { color: #475d77; font-size: 8px; }
.category-bars em { color: #8a96a7; font-size: 7px; font-style: normal; }
.category-bars i { display: block; height: 5px; margin-top: 5px; overflow: hidden; border-radius: 99px; background: #eaf0f5; }
.category-bars u { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #258fd9, #31ad79); text-decoration: none; }
.category-bars.expense u { background: linear-gradient(90deg, #d45162, #e28a4c); }

.report-ledger .finance-ledger-header,
.report-ledger .finance-ledger-row { grid-template-columns: 120px 120px 105px minmax(170px, 1fr) 115px 35px; }

/* Income-expense readability and period filter */
.finance-filter-disabled { opacity: .48; }
.finance-filter-disabled input { cursor: not-allowed; background: #edf1f6; }
.finance-period-filter { min-width: 112px !important; }
.income-expense-kpis article { gap: 13px; padding: 17px; }
.income-expense-kpis article > span { width: 44px; height: 44px; font-size: 18px; }
.income-expense-kpis small { font-size: 9.5px; }
.income-expense-kpis strong { font-size: 18px; }
.income-expense-kpis em { font-size: 9.5px; }
.finance-report-toolbar { padding: 13px; }
.finance-report-filter label small { font-size: 8.5px; }
.finance-report-filter input,
.finance-report-filter select { height: 39px; font-size: 10.5px; }
.finance-report-filter .finance-search > span { height: 39px; }
.finance-report-filter .finance-search input { height: 37px; font-size: 10.5px; }
.finance-report-filter .finance-search button { min-width: 70px; font-size: 9.5px; }
.income-expense-workspace { grid-template-columns: 355px minmax(0, 1fr); gap: 15px; }
.finance-entry-card { padding: 18px; }
.finance-entry-card .finance-panel-title h2 { font-size: 16px; }
.finance-entry-card .finance-panel-title small { font-size: 9.5px; }
.finance-entry-card .finance-entry-form { gap: 12px; }
.finance-entry-card .finance-entry-form > label,
.finance-entry-card .finance-entry-form .finance-form-row label { font-size: 10.5px; }
.finance-entry-card .finance-entry-form label em { font-size: 8.5px; }
.finance-entry-card .finance-entry-form input,
.finance-entry-card .finance-entry-form select,
.finance-entry-card .finance-entry-form textarea { height: 41px; font-size: 10.5px; }
.finance-entry-card .finance-entry-form textarea { min-height: 72px; }
.finance-entry-card .finance-type-switch span { height: 43px; font-size: 11.5px; }
.finance-entry-card .finance-save-button { padding: 13px; font-size: 10.5px; }
.finance-breakdowns > article { padding: 16px; }
.finance-breakdowns header small { font-size: 8.5px; }
.finance-breakdowns header strong { font-size: 15px; }
.finance-breakdowns header > span { padding: 5px 8px; font-size: 8.5px; }
.finance-breakdowns article > p { font-size: 10px; }
.category-bars { gap: 11px; }
.category-bars b { font-size: 10px; }
.category-bars em { font-size: 9px; }
.category-bars i { height: 6px; }
.report-ledger .finance-ledger-header { min-height: 44px; font-size: 8.5px; }
.report-ledger .finance-ledger-row { min-height: 84px; }
.report-ledger .finance-transaction-id span { font-size: 9.5px; }
.report-ledger .finance-transaction-id strong { font-size: 9.5px; }
.report-ledger .finance-transaction-id small { font-size: 8.5px; }
.report-ledger .finance-type { padding: 4px 7px; font-size: 8.5px; }
.report-ledger .finance-source strong,
.report-ledger .finance-method strong,
.report-ledger .finance-description strong { font-size: 10px; }
.report-ledger .finance-source small,
.report-ledger .finance-method small,
.report-ledger .finance-description small { font-size: 8.5px; }
.report-ledger .finance-amount strong { font-size: 11.5px; }
.report-ledger .finance-amount small { font-size: 8.5px; }
.finance-heading-actions a { padding: 11px 14px; font-size: 10px; }
.price-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.checkout-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.checkout-form > .validation,
.checkout-form > button,
.checkout-form > label:last-of-type {
    grid-column: 1 / -1;
}

.checkout-form select,
.checkout-form input {
    width: 100%;
}

@media (max-width: 1380px) {
    .cash-method-grid { grid-template-columns: repeat(3, 1fr); }
    .finance-report-filter { flex-wrap: wrap; }
    .finance-report-filter label { flex: 1; }
    .finance-report-filter .finance-search { flex-basis: 280px; }
}

@media (max-width: 1180px) {
    .finance-kpis { grid-template-columns: 1fr 1fr; }
    .cash-workspace,
    .income-expense-workspace { grid-template-columns: 1fr; }
    .finance-entry-card { position: static; }
    .cash-entry-panel,
    .finance-entry-card { display: grid; grid-template-columns: 1fr 1.5fr; gap: 14px; }
    .cash-entry-panel .finance-panel-title,
    .finance-entry-card .finance-panel-title { border-bottom: 0; }
    .cash-entry-panel .refund-panel { grid-column: 1 / -1; }
    .finance-toolbar { align-items: stretch; flex-direction: column; }
    .finance-search-form { width: 100%; }
    .finance-search-form label { flex: 1; }
}

@media (max-width: 900px) {
    .finance-heading { align-items: stretch; flex-direction: column; }
    .finance-heading-actions a { flex: 1; text-align: center; }
    .cash-date-bar { align-items: stretch; flex-direction: column; }
    .cash-date-bar form label { flex: 1; }
    .cash-method-grid { grid-template-columns: 1fr 1fr; }
    .finance-ledger-header { display: none; }
    .finance-ledger-row,
    .report-ledger .finance-ledger-row { grid-template-columns: 1fr 1fr 95px 35px; gap: 12px; }
    .finance-description { grid-column: 1 / 3; }
    .finance-amount { grid-column: 3; grid-row: 1 / 3; }
    .finance-row-actions { grid-column: 4; grid-row: 1 / 3; }
    .finance-breakdowns { grid-template-columns: 1fr; }
    .price-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .finance-main { padding-left: 12px; padding-right: 12px; }
    .finance-kpis { grid-template-columns: 1fr 1fr; }
    .cash-entry-panel,
    .finance-entry-card { display: block; }
    .cash-entry-panel .finance-entry-form,
    .finance-entry-card .finance-entry-form { margin-top: 14px; }
    .finance-search-form { align-items: stretch; flex-direction: column; }
    .finance-search { min-width: 100% !important; }
    .finance-report-filter label { min-width: calc(50% - 4px); }
    .finance-report-filter .finance-search { min-width: 100% !important; flex-basis: 100%; }
    .finance-ledger-row,
    .report-ledger .finance-ledger-row { grid-template-columns: 1fr 32px; }
    .finance-source,
    .finance-method,
    .finance-description,
    .finance-amount { grid-column: 1; grid-row: auto; text-align: left; }
    .finance-row-actions { grid-column: 2; grid-row: 1 / 5; }
    .finance-row-actions form { right: 0; width: min(220px, 76vw); }
    .checkout-form { grid-template-columns: 1fr; }
    .checkout-form > * { grid-column: 1 !important; }
}
