.expense-page {
    background: #f4f7fb;
    color: #263238;
    font-family: "Open Sans", Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

.expense-page,
.expense-page * {
    box-sizing: border-box;
}

[x-cloak] {
    display: none !important;
}

.expense-shell {
    margin-top: 70px;
    padding-bottom: 44px;
    padding-top: 0;
}

.expense-page .demo-header > .container,
.expense-page .expense-toolbar > .container,
.expense-page .expense-shell > .container {
    max-width: 1440px;
    width: calc(100% - 48px);
}

.expense-toolbar {
    background: #fff;
    border-bottom: 1px solid #dfe7ef;
    box-shadow: 0 4px 14px rgba(31, 45, 61, 0.06);
    margin-bottom: 14px;
    padding: 10px 0 0;
    position: sticky;
    top: 0;
    z-index: 900;
}

.expense-toolbar-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 10px;
}

.expense-toolbar-head h2 {
    color: #263238;
    font-size: 20px;
    font-weight: 700;
    margin: 2px 0 0;
}

.expense-eyebrow {
    color: #0063B0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.expense-link-button,
.expense-action,
.expense-primary {
    align-items: center;
    border-radius: 6px;
    display: inline-flex;
    font-weight: 700;
    gap: 7px;
    min-height: 36px;
    padding: 7px 12px;
}

.expense-link-button:disabled,
.expense-action:disabled,
.expense-primary:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.expense-link-button,
.expense-action {
    background: #fff;
    border: 1px solid #cbd8e3;
    color: #0063B0;
}

.expense-primary {
    background: #0063B0;
    border: 1px solid #0063B0;
    color: #fff;
}

.expense-filter-grid,
.expense-form-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.expense-form-grid {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    margin-bottom: 16px;
}

.expense-form-grid_wide {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.expense-field_span-2 {
    grid-column: span 2;
}

.expense-field_span-4 {
    grid-column: span 4;
}

.expense-label {
    color: #667784;
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.expense-select,
.expense-input {
    background: #fff;
    border: 1px solid #cbd8e3;
    border-radius: 6px;
    color: #263238;
    min-height: 36px;
    padding: 7px 10px;
    width: 100%;
}

.expense-select:focus,
.expense-input:focus {
    border-color: #0063B0;
    box-shadow: 0 0 0 3px rgba(0, 99, 176, 0.12);
    outline: none;
}

.expense-input.is-invalid,
.expense-select.is-invalid {
    border-color: #d9534f;
}

.expense-field-error {
    color: #b54133;
    display: block;
    font-size: 12px;
    margin-top: 5px;
}

.expense-textarea {
    min-height: 82px;
    resize: vertical;
}

.expense-tabs {
    border-top: 1px solid #edf2f7;
    display: flex;
    gap: 20px;
    margin-top: 10px;
    overflow-x: auto;
    padding-top: 6px;
}

.expense-tab {
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    color: #394b59;
    flex: 0 0 auto;
    font-weight: 700;
    min-height: 34px;
    padding: 5px 0 7px;
    white-space: nowrap;
}

.expense-tab:hover,
.expense-tab.is-active {
    border-bottom-color: #0063B0;
    color: #0063B0;
}

.expense-tab .glyphicon {
    margin-right: 5px;
}

.expense-section {
    background: #fff;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(31, 45, 61, 0.06);
    margin-bottom: 18px;
    padding: 22px;
}

.expense-section-head {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.expense-section-head h2 {
    color: #263238;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
}

.expense-section-head p {
    color: #667784;
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
    max-width: 760px;
}

.expense-section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.expense-badge,
.expense-status,
.expense-section-counter {
    background: #eef6fc;
    border-radius: 999px;
    color: #0063B0;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 9px;
}

.expense-section-counter {
    background: #f3f7fb;
    color: #394b59;
}

.expense-kpi-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    margin-bottom: 18px;
}

.expense-kpi {
    border: 1px solid #e2ebf2;
    border-radius: 8px;
    min-height: 124px;
    padding: 16px;
}

.expense-kpi-label {
    color: #667784;
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.expense-kpi strong {
    color: #263238;
    display: block;
    font-size: 25px;
    line-height: 1.25;
    margin-bottom: 8px;
}

.expense-kpi small {
    color: #667784;
    display: block;
    line-height: 1.35;
}

.expense-info-panel {
    align-items: center;
    background: #f7fafc;
    border: 1px solid #e2ebf2;
    border-radius: 8px;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.8fr);
    padding: 18px;
}

.expense-info-panel h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px;
}

.expense-info-panel p,
.expense-progress span {
    color: #667784;
    font-size: 13px;
    margin: 0;
}

.expense-progress-bar {
    background: #dfe7ef;
    border-radius: 999px;
    height: 8px;
    margin-top: 8px;
    overflow: hidden;
}

.expense-progress-bar span {
    background: #0063B0;
    display: block;
    height: 100%;
}

.expense-plan-list {
    border: 1px solid #e2ebf2;
    border-radius: 8px;
    margin-top: 18px;
    overflow: hidden;
}

.expense-plan-row {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr);
    padding: 12px 16px;
}

.expense-plan-row + .expense-plan-row {
    border-top: 1px solid #e2ebf2;
}

.expense-plan-row strong,
.expense-plan-row span {
    display: block;
}

.expense-plan-row strong {
    color: #263238;
    font-size: 14px;
}

.expense-plan-row span {
    color: #667784;
    font-size: 13px;
}

.expense-plan-values {
    display: grid;
    gap: 8px;
}

.expense-table-wrap {
    border: 1px solid #e2ebf2;
    border-radius: 8px;
    overflow-x: auto;
}

.expense-table {
    margin: 0;
    min-width: 860px;
    width: 100%;
}

.expense-table_works {
    min-width: 760px;
}

.expense-table_receipts {
    min-width: 760px;
}

.expense-table th,
.expense-table td {
    border-bottom: 1px solid #e2ebf2;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.expense-table th {
    background: #f7fafc;
    color: #667784;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.expense-table td {
    color: #263238;
    font-size: 12px;
}

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

.expense-table strong,
.expense-table span {
    display: block;
}

.expense-table span {
    color: #667784;
    margin-top: 3px;
}

.expense-table .expense-status {
    color: #0063B0;
    display: inline-block;
    margin-top: 0;
    white-space: nowrap;
}

.expense-table_works td:nth-child(5) strong,
.expense-table_works td:nth-child(7) strong {
    white-space: nowrap;
}

.expense-table_receipts td:nth-child(3) strong {
    white-space: nowrap;
}

.expense-table-group.is-selected > .expense-data-row td {
    background: #f7fbff;
}

.expense-data-row {
    cursor: pointer;
}

.expense-data-row:hover td {
    background: #fbfdff;
}

.expense-data-row:focus {
    outline: 2px solid rgba(0, 99, 176, 0.22);
    outline-offset: -2px;
}

.expense-detail-row td {
    background: #f7fbff;
    padding: 0 10px 12px;
}

.expense-table .expense-empty {
    color: #667784;
    padding: 24px;
    text-align: center;
}

.expense-row-button {
    background: transparent;
    border: 0;
    color: #263238;
    padding: 0;
    text-align: left;
}

.expense-row-button:hover strong {
    color: #0063B0;
}

.expense-status_planned {
    background: #eef2f6;
    color: #465766;
}

.expense-status_progress {
    background: #fff4df;
    color: #8a5a00;
}

.expense-status_done {
    background: #e9f6ff;
    color: #0063B0;
}

.expense-status_accepted,
.expense-status_paid {
    background: #e8f6ee;
    color: #1f7a3e;
}

.expense-status_problem {
    background: #fff0ef;
    color: #b54133;
}

.expense-status_warning {
    background: #fff4df;
    color: #8a5a00;
}

.expense-markers {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.expense-marker {
    background: #fff4df;
    border-radius: 999px;
    color: #8a5a00;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 7px;
}

.expense-marker_ok {
    background: #e8f6ee;
    color: #1f7a3e;
}

.expense-work-layout {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
}

.expense-receipt-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
}

.expense-detail {
    background: #f7fafc;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    padding: 16px;
    position: sticky;
    top: 170px;
}

.expense-detail_inline {
    box-shadow: inset 3px 0 0 #0063B0;
    position: static;
}

.expense-detail-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
}

.expense-document-grid {
    grid-template-columns: minmax(230px, 0.45fr) minmax(0, 1fr);
}

.expense-detail-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.expense-detail-head span:first-child {
    color: #667784;
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.expense-detail-head h3 {
    color: #263238;
    font-size: 18px;
    font-weight: 700;
    margin: 3px 0 0;
}

.expense-detail-list {
    margin: 0;
}

.expense-detail-list div {
    border-top: 1px solid #e2ebf2;
    padding: 10px 0;
}

.expense-detail-list dt {
    color: #667784;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.expense-detail-list dd {
    color: #263238;
    font-size: 13px;
    margin: 0;
}

.expense-detail-note {
    background: #fff4df;
    border-radius: 8px;
    color: #8a5a00;
    margin-top: 10px;
    padding: 10px;
}

.expense-detail-note strong,
.expense-detail-note span {
    display: block;
}

.expense-detail-note span {
    font-size: 13px;
    margin-top: 3px;
}

.expense-detail-block {
    border-top: 1px solid #e2ebf2;
    margin-top: 14px;
    padding-top: 14px;
}

.expense-detail-block h4 {
    color: #263238;
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 10px;
}

.expense-linked-receipt {
    background: #fff;
    border: 1px solid #e2ebf2;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 10px;
}

.expense-linked-receipt strong,
.expense-linked-receipt span {
    display: block;
}

.expense-linked-receipt span {
    color: #667784;
    font-size: 12px;
    margin-top: 3px;
}

.expense-linked-receipt_empty {
    color: #667784;
    font-size: 13px;
}

.expense-file-state {
    background: #e8f6ee;
    border-radius: 999px;
    color: #1f7a3e;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 7px;
}

.expense-file-state.is-missing {
    background: #eef2f6;
    color: #667784;
}

.expense-document-preview {
    align-items: center;
    background: #fff;
    border: 1px dashed #cbd8e3;
    border-radius: 8px;
    display: grid;
    gap: 4px;
    justify-items: center;
    margin-bottom: 14px;
    min-height: 126px;
    padding: 16px;
    text-align: center;
}

.expense-document-preview .glyphicon {
    color: #0063B0;
    font-size: 28px;
}

.expense-document-preview strong {
    color: #263238;
    font-size: 14px;
}

.expense-document-preview small {
    color: #667784;
    font-size: 12px;
}

.expense-pagination {
    align-items: center;
    color: #667784;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 12px;
}

.expense-page-button {
    align-items: center;
    background: #fff;
    border: 1px solid #cbd8e3;
    border-radius: 6px;
    color: #0063B0;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.expense-page-button:disabled {
    color: #aeb9c2;
    cursor: not-allowed;
}

.expense-form {
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    padding: 18px;
}

.expense-form-layout {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) 330px;
}

.expense-form-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.expense-upload-card {
    background: #f7fafc;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    padding: 14px;
}

.expense-upload-card.is-processing {
    box-shadow: inset 3px 0 0 #f0ad4e;
}

.expense-upload-preview {
    align-items: center;
    background: #fff;
    border: 1px dashed #cbd8e3;
    border-radius: 8px;
    display: grid;
    gap: 5px;
    justify-items: center;
    min-height: 138px;
    padding: 18px;
    text-align: center;
}

.expense-upload-preview .glyphicon {
    color: #0063B0;
    font-size: 32px;
}

.expense-upload-preview strong {
    color: #263238;
    font-size: 15px;
}

.expense-upload-preview small {
    color: #667784;
    font-size: 12px;
    line-height: 1.35;
}

.expense-upload-status {
    border-bottom: 1px solid #e2ebf2;
    margin-bottom: 12px;
    padding: 12px 0;
}

.expense-upload-status p {
    color: #667784;
    font-size: 13px;
    line-height: 1.4;
    margin: 8px 0 0;
}

.expense-upload-steps {
    color: #394b59;
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
    padding-left: 18px;
}

.expense-upload-steps li + li {
    margin-top: 5px;
}

.expense-demo-alert {
    align-items: flex-start;
    background: #f7fafc;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    color: #394b59;
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.expense-demo-alert .glyphicon {
    color: #0063B0;
    margin-top: 2px;
}

.expense-demo-alert p {
    color: #394b59;
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
}

.expense-kpi-grid_exchange {
    margin-bottom: 16px;
}

.expense-exchange-layout {
    align-items: start;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
    margin-bottom: 16px;
}

.expense-exchange-result,
.expense-exchange-side {
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    padding: 16px;
}

.expense-exchange-result.is-processing {
    border-color: #f1cf8f;
    box-shadow: 0 0 0 3px rgba(241, 207, 143, 0.24);
}

.expense-exchange-result > p,
.expense-exchange-side {
    color: #667784;
    font-size: 13px;
    line-height: 1.45;
}

.expense-exchange-side {
    background: #f7fafc;
}

.expense-exchange-side h3,
.expense-exchange-columns h4 {
    color: #263238;
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 10px;
}

.expense-exchange-columns {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.expense-muted {
    color: #667784;
    font-size: 13px;
    margin: 0;
}

.expense-exchange-table-wrap {
    margin-top: 8px;
}

.expense-table_exchange {
    min-width: 780px;
}

.expense-toast {
    background: #263238;
    border-radius: 8px;
    bottom: 24px;
    box-shadow: 0 10px 30px rgba(31, 45, 61, 0.22);
    color: #fff;
    font-weight: 700;
    left: 50%;
    max-width: 420px;
    padding: 12px 16px;
    position: fixed;
    text-align: center;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    z-index: 1200;
}

@media (min-width: 768px) and (max-width: 1199px) {
    .expense-shell {
        margin-top: 88px;
    }

    .expense-filter-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }

    .expense-form-grid,
    .expense-kpi-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

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

    .expense-field_span-4 {
        grid-column: span 2;
    }

    .expense-work-layout {
        grid-template-columns: 1fr;
    }

    .expense-detail {
        position: static;
    }

    .expense-detail-grid,
    .expense-document-grid,
    .expense-exchange-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .expense-page .demo-header > .container,
    .expense-page .expense-toolbar > .container,
    .expense-page .expense-shell > .container {
        margin-left: 12px;
        margin-right: 12px;
        max-width: none;
        padding-left: 0;
        padding-right: 0;
        width: calc(100vw - 24px);
    }

    .expense-page .demo-header {
        padding: 10px 0;
    }

    .expense-page .demo-header-inner {
        gap: 8px;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .expense-page .demo-header-logo {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .expense-page .demo-header-logo img {
        height: 28px;
    }

    .expense-page .demo-header-title {
        font-size: 13px;
        line-height: 1.2;
    }

    .expense-page .demo-header-note {
        display: none;
    }

    .expense-page .demo-header-back {
        font-size: 12px;
        margin-left: 38px;
        max-width: none;
        white-space: nowrap;
    }

    .expense-shell {
        margin-top: 84px;
    }

    .expense-toolbar {
        position: static;
    }

    .expense-toolbar-head h2 {
        font-size: 18px;
    }

    .expense-filter-grid,
    .expense-form-grid,
    .expense-form-layout,
    .expense-exchange-columns,
    .expense-exchange-layout,
    .expense-kpi-grid,
    .expense-info-panel,
    .expense-plan-row,
    .expense-work-layout {
        grid-template-columns: 1fr;
    }

    .expense-field_span-2,
    .expense-field_span-4 {
        grid-column: span 1;
    }

    .expense-detail {
        position: static;
    }

    .expense-detail-grid,
    .expense-document-grid {
        grid-template-columns: 1fr;
    }

    .expense-pagination {
        justify-content: center;
    }

    .expense-section-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .expense-section-actions .expense-action {
        justify-content: center;
        width: 100%;
    }

    .expense-tabs {
        display: grid;
        gap: 8px 14px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow-x: visible;
    }

    .expense-tab {
        text-align: left;
        white-space: normal;
    }

    .expense-section {
        padding: 16px;
    }

    .expense-section-head h2 {
        font-size: 18px;
    }
}
