
/* Terra Computer — кабінет користувача */

.terra-profile-page {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto 30px;
    color: #303b43;
}

.terra-profile-tabs {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 5px;
    padding: 10px 12px 5px;
    background: #075e31;
}

.terra-profile-tab {
    border: 1px solid #a0a0a0;
    border-radius: 6px 6px 0 0;
    background: #b9b9b9;
    color: #555;
    font-size: 14px;
    padding: 10px 22px;
    cursor: pointer;
}

.terra-profile-tab.is-active {
    background: #d8f2df;
    border-color: #00a14b;
    color: #00883d;
    box-shadow: inset 0 3px 0 #00a14b;
}

.terra-profile-content {
    padding: 16px;
    background: #ededed;
    min-height: 340px;
}

.terra-profile-section {
    margin-bottom: 11px;
}

.terra-profile-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 17px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #555;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
}

.terra-profile-section-title:hover {
    border-color: #00a14b;
}

.terra-profile-arrow {
    font-size: 20px;
    color: #999;
}

.terra-profile-section-body {
    padding: 18px;
    margin-top: 2px;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 5px;
}

.terra-profile-field {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.terra-profile-field-label {
    min-width: 180px;
    color: #777;
}

.terra-profile-notice {
    margin: 5px 0;
    color: #666;
    line-height: 1.6;
}

.terra-profile-menu-link {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin-bottom: 2px;
    padding: 15px 18px;
    border: 1px solid #d8dce0;
    background: #fff;
    text-align: left;
    font-size: 15px;
    color: #334257;
    cursor: pointer;
}

.terra-profile-menu-link:hover {
    background: #eaf6ee;
}

.terra-profile-menu-link span:first-child {
    font-size: 22px;
    color: #168b48;
}

.terra-profile-report-content {
    background: #fff;
    padding: 16px;
    margin-bottom: 12px;
}

.terra-profile-buyer {
    padding: 9px;
    border-bottom: 1px solid #eee;
}

.terra-profile-message {
    margin: 30px auto;
    padding: 25px;
    max-width: 700px;
    text-align: center;
}

@media (max-width: 650px) {
    .terra-profile-tabs {
        gap: 3px;
        padding: 8px 4px 3px;
    }

    .terra-profile-tab {
        font-size: 11px;
        padding: 10px 8px;
        flex: 1;
    }

    .terra-profile-content {
        padding: 10px;
    }

    .terra-profile-field-label {
        min-width: 100%;
    }
}


/* Terra Cabinet v2 */

.terra-cabinet-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.terra-cabinet-field {
    flex: 1 1 180px;
    min-width: 150px;
    max-width: 320px;
}

.terra-cabinet-field label {
    display: block;
    margin-bottom: 5px;
    color: #777;
    font-size: 12px;
}

.terra-cabinet-value,
.terra-cabinet-input {
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #d5d5d5;
    border-radius: 4px;
    background: #f1f1f1;
    color: #444;
    font-size: 13px;
    box-sizing: border-box;
}

.terra-cabinet-input:focus {
    outline: 1px solid #00a04a;
    background: #fff;
}

.terra-cabinet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.terra-cabinet-button {
    border: 1px solid #159447;
    border-radius: 20px;
    padding: 8px 19px;
    background: #269b44;
    color: white;
    cursor: pointer;
}

.terra-cabinet-button:disabled {
    background: #aaa;
    border-color: #aaa;
    cursor: not-allowed;
}

.terra-cabinet-cancel {
    background: #aaa;
    border-color: #159447;
}

.terra-cabinet-buyer {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ddd;
}

.terra-cabinet-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 25px;
    margin-top: 15px;
}

.terra-cabinet-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.terra-cabinet-checkbox input {
    accent-color: #239b45;
}

.terra-cabinet-message {
    padding: 12px;
    margin-bottom: 15px;
    background: #e4f5e8;
    border-left: 3px solid #239b45;
}

.terra-profile-section-body {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
}

.terra-profile-section-title {
    cursor: pointer;
}

@media (max-width: 600px) {
    .terra-cabinet-row {
        gap: 12px;
    }

    .terra-cabinet-field {
        max-width: none;
        flex: 1 1 100%;
    }
}


/* Terra Cabinet — отримувачі замовлень */

.terra-recipient-default {
    max-width: 360px;
    margin-bottom: 25px;
}

.terra-recipient-editor {
    border-top: 1px solid #ddd;
    padding: 18px 0;
}

.terra-recipient-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    color: #666;
    font-size: 13px;
}

.terra-recipient-delete {
    background: transparent;
    border: 0;
    color: #c44;
    cursor: pointer;
}

.terra-recipient-add {
    display: inline-block;
    margin: 12px 0;
    background: transparent;
    border: none;
    color: #229947;
    cursor: pointer;
    font-size: 14px;
}

.terra-recipient-add:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.terra-recipient-view {
    position: relative;
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}

.terra-recipient-main {
    display: inline-block;
    color: #229947;
    font-size: 12px;
    margin-bottom: 10px;
}


/* Terra Documents Tabs v1 */

.terra-profile-page {
    margin-top: 0;
}

.terra-profile-tabs {
    gap: 3px;
    padding: 5px 12px 4px;
}

.terra-profile-tab {
    padding: 8px 19px;
    border-radius: 7px 7px 0 0;
}

.terra-profile-content {
    padding: 12px 14px 18px;
}

.terra-cabinet-document-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 2px;
    margin: 0 0 12px;
    padding: 0 0 0 3px;
    border-bottom: 2px solid #aaa;
}

.terra-cabinet-document-tab {
    appearance: none;
    border: 1px solid #a3a3a3;
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    background: #bdbdbd;
    color: #555;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.2;
    padding: 9px 17px;
    cursor: pointer;
    transition: background 0.15s;
}

.terra-cabinet-document-tab:hover {
    background: #d4e9d8;
}

.terra-cabinet-document-tab.is-active {
    background: #a6e8b5;
    color: #08783b;
    border-color: #00a14b;
    box-shadow: inset 0 3px 0 #00a14b;
}

.terra-cabinet-document-notice {
    padding: 22px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #666;
}

@media (max-width: 650px) {
    .terra-cabinet-document-tabs {
        gap: 3px;
    }

    .terra-cabinet-document-tab {
        font-size: 11px;
        padding: 9px 10px;
    }

    .terra-profile-content {
        padding: 8px;
    }
}


/* Terra Hide Profile Heading v1 */

/* Приховуємо заголовок лише на сторінці кабінету */
body:has(.terra-profile-page)
div.p-p-1.p-text-uppercase.p-text-bold {
    display: none !important;
}


/* Terra Profile Remove Empty Header v1 */

/* Прибираємо порожню смугу заголовка тільки в кабінеті */
body.terra:has(.terra-profile-page) > div .header > .title {
    display: none !important;
}

/* Верхні вкладки без зайвого проміжку */
.terra-profile-tabs {
    margin-top: 0 !important;
}


/* Terra Invoices Inline v1 */

.terra-invoices-inline {
    width: 100%;
}

.terra-invoices-toolbar {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f6f6f6;
    margin-bottom: 12px;
}

.terra-invoices-search {
    flex: 1;
    min-width: 0;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.terra-invoices-toolbar button {
    border: 1px solid #009b47;
    background: #fff;
    color: #008a3f;
    border-radius: 5px;
    cursor: pointer;
    padding: 8px 15px;
}

.terra-invoice-header,
.terra-invoice-row {
    display: grid;
    grid-template-columns:
        minmax(115px, 1fr)
        110px
        minmax(180px, 2fr)
        125px
        170px;
    align-items: center;
    gap: 10px;
}

.terra-invoice-header {
    padding: 12px 18px;
    background: #d4d4d4;
    border-radius: 5px;
    font-size: 13px;
}

.terra-invoice-item {
    margin-top: 6px;
}

.terra-invoice-row {
    width: 100%;
    position: relative;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    text-align: left;
    padding: 13px 18px 13px 28px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
}

.terra-invoice-row:hover {
    border-color: #00a14b;
}

.terra-invoice-row.is-open {
    border-color: #00a14b;
    border-radius: 8px 8px 0 0;
}

.terra-invoice-arrow {
    position: absolute;
    left: 9px;
    font-size: 17px;
}

.terra-invoice-amount {
    text-align: right;
}

.terra-invoice-status {
    color: #555;
}

.terra-invoice-expanded {
    padding: 15px;
    background: white;
    border: 1px solid #00a14b;
    border-top: 0;
    border-radius: 0 0 8px 8px;
}

.terra-invoice-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.terra-invoice-actions a {
    color: #008b3d;
}

.terra-invoice-preview {
    display: block;
    width: 100%;
    height: 760px;
    border: 1px solid #ddd;
    background: white;
}

.terra-invoice-error {
    padding: 15px;
    color: #b00020;
}

@media (max-width: 850px) {
    .terra-invoice-header {
        display: none;
    }

    .terra-invoice-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 15px;
    }

    .terra-invoice-preview {
        height: 550px;
    }
}


/* Terra Journal Layout v2 */

.terra-journal-invoices .terra-invoice-header,
.terra-journal-invoices .terra-invoice-row {
    grid-template-columns:
        minmax(125px, 1.05fr)
        minmax(145px, 1.1fr)
        105px
        minmax(170px, 1.6fr)
        130px
        minmax(145px, 1.2fr);
}

.terra-journal-reserves .terra-invoice-header,
.terra-journal-reserves .terra-invoice-row {
    grid-template-columns:
        minmax(125px, 1fr)
        110px
        minmax(180px, 2fr)
        135px
        minmax(175px, 1.4fr);
}

.terra-journal-quantity-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    text-align: right;
}

.terra-journal-quantity {
    color: #555;
    font-size: 12px;
}

.terra-journal-money {
    font-size: 12px;
    color: #333;
}

.terra-journal-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1.4;
}

.terra-journal-status-icon {
    font-size: 15px;
    flex: 0 0 auto;
}

.terra-journal-status.is-success {
    color: #309b57;
}

.terra-journal-status.is-warning {
    color: #e87922;
}

.terra-journal-status.is-muted {
    color: #999;
}

.terra-journal-reserves
.terra-invoice-row.is-open {
    border-left: 5px solid #239e47;
}

.terra-journal-invoices
.terra-invoice-row.is-open {
    border-left: 5px solid #239e47;
}

.terra-journal-reserves
.terra-invoice-expanded {
    border-color: #239e47;
}

@media (max-width: 850px) {
    .terra-journal-invoices .terra-invoice-row,
    .terra-journal-reserves .terra-invoice-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 15px;
    }

    .terra-journal-invoices .terra-invoice-header,
    .terra-journal-reserves .terra-invoice-header {
        display: none;
    }
}

/* Terra Journal TZ v3 */

.terra-journal-reserves .terra-invoice-actions strong {
    display: inline-block;
    background: #159d45;
    color: #fff;
    padding: 9px 18px;
    border-radius: 0 0 15px 0;
    font-size: 13px;
}

.terra-journal-invoices .terra-invoice-actions strong {
    display: inline-block;
    background: #159d45;
    color: #fff;
    padding: 9px 18px;
    border-radius: 0 0 15px 0;
    font-size: 13px;
}

.terra-journal-invoices .terra-invoice-actions,
.terra-journal-reserves .terra-invoice-actions {
    align-items: center;
}

.terra-journal-invoices .terra-invoice-expanded,
.terra-journal-reserves .terra-invoice-expanded {
    padding-top: 0;
}

.terra-journal-invoices .terra-invoice-row,
.terra-journal-reserves .terra-invoice-row {
    transition: border-color .15s ease;
}

.terra-journal-invoices .terra-invoice-row:hover,
.terra-journal-reserves .terra-invoice-row:hover {
    border-color: #159d45;
}

@media (max-width: 650px) {
    .terra-journal-invoices .terra-invoice-actions,
    .terra-journal-reserves .terra-invoice-actions {
        flex-wrap: wrap;
    }

    .terra-journal-invoices .terra-invoices-toolbar,
    .terra-journal-reserves .terra-invoices-toolbar {
        flex-wrap: wrap;
    }
}

/* Terra Original Status Icons v1 */

.terra-journal-status-image {
    display: inline-block;
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}

.terra-journal-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    line-height: 1.35;
}

.terra-journal-status.is-warning {
    color: #e87922;
}

.terra-journal-status.is-muted {
    color: #999;
}

.terra-journal-status.is-success {
    color: #25994a;
}


/* Terra Cash Journal TZ v1 */

.terra-journal-cash .terra-invoice-header,
.terra-journal-cash .terra-cash-row {
    display: grid;
    grid-template-columns:
        minmax(120px, 1fr)
        minmax(145px, 1.2fr)
        minmax(155px, 1.2fr)
        minmax(170px, 1.7fr)
        minmax(110px, 0.9fr)
        minmax(150px, 1.2fr);
    align-items: center;
    gap: 12px;
}

.terra-journal-cash .terra-cash-row {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    margin-bottom: 7px;
    border: 1px solid #e3e3e3;
    border-radius: 5px;
    background: #fff;
    color: #333;
    font-size: 12px;
    cursor: default;
}

.terra-journal-cash .terra-cash-row:hover {
    background: #f7fbf8;
}

.terra-journal-cash .terra-cash-money {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.terra-journal-cash .terra-cash-status-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid currentColor;
    border-radius: 3px;
    font-size: 15px;
    font-weight: bold;
}

@media (max-width: 950px) {
    .terra-journal-cash .terra-invoice-header {
        display: none;
    }

    .terra-journal-cash .terra-cash-row {
        display: flex;
        flex-wrap: wrap;
        gap: 9px 14px;
    }
}


/* Terra Expenses Inline v1 */

.terra-expenses-inline {
    padding: 12px 0 20px;
}

.terra-expenses-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.terra-expenses-toolbar input {
    flex: 1 1 260px;
    min-width: 180px;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px 12px;
    background: #fff;
}

.terra-expenses-toolbar button {
    padding: 9px 15px;
    border: 1px solid #239e47;
    color: #15873a;
    background: #fff;
    border-radius: 5px;
    cursor: pointer;
}

.terra-expenses-toolbar button:hover {
    background: #e9f7ee;
}

.terra-expenses-header,
.terra-expenses-row {
    display: grid;
    grid-template-columns:
        minmax(125px, 1fr)
        minmax(105px, 1.05fr)
        minmax(180px, 1.8fr)
        minmax(115px, 1fr)
        minmax(175px, 1.45fr);
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    font-size: 12px;
}

.terra-expenses-header {
    background: #d4d4d4;
    color: #555;
    border-radius: 5px;
    margin-bottom: 7px;
}

.terra-expenses-item {
    margin-bottom: 6px;
}

.terra-expenses-row {
    width: 100%;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    background: #fff;
    color: #555;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.terra-expenses-row:hover {
    background: #f4fbf6;
}

.terra-expenses-row.is-open {
    border-left: 5px solid #239e47;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.terra-expenses-number {
    display: flex;
    align-items: center;
    gap: 6px;
}

.terra-expenses-arrow {
    font-size: 15px;
}

.terra-expenses-client {
    overflow-wrap: anywhere;
}

.terra-expenses-amount {
    display: flex;
    flex-direction: column;
    text-align: right;
    gap: 3px;
}

.terra-expenses-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.terra-expenses-status img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.terra-expenses-status.is-conducted {
    color: #309b57;
}

.terra-expenses-status.is-pending {
    color: #777;
}

.terra-expenses-expanded {
    background: #fff;
    padding: 12px;
    border: 1px solid #239e47;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.terra-expenses-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.terra-expenses-actions a {
    color: #16873b;
    text-decoration: none;
    border: 1px solid #239e47;
    padding: 7px 12px;
    border-radius: 5px;
}

.terra-expenses-preview {
    display: block;
    width: 100%;
    height: 650px;
    border: 1px solid #ddd;
    background: white;
}

@media (max-width: 850px) {
    .terra-expenses-header {
        display: none;
    }

    .terra-expenses-row {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 15px;
    }

    .terra-expenses-preview {
        height: 500px;
    }
}


/* Terra Reports Inline v1 */

.terra-reports-inline {
    padding: 0 0 22px;
}

.terra-reports-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #aaa;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.terra-reports-tab {
    padding: 11px 16px;
    color: #555;
    background: #bcbcbc;
    border: 1px solid #999;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
}

.terra-reports-tab.is-active {
    background: #a8edb9;
    border-color: #219e47;
    color: #136e34;
}

.terra-reports-parameters {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin: 0 auto 14px;
    max-width: 370px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.terra-reports-parameters label {
    display: block;
    margin-bottom: 12px;
}

.terra-reports-label {
    display: block;
    color: #777;
    font-size: 12px;
    margin-bottom: 4px;
}

.terra-reports-parameters select,
.terra-reports-parameters input[type=date] {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #eee;
    box-sizing: border-box;
    font-size: 12px;
}

.terra-reports-dates {
    display: flex;
    align-items: center;
    gap: 7px;
}

.terra-reports-dates input {
    min-width: 0;
}

.terra-reports-checkbox {
    display: flex !important;
    align-items: center;
    gap: 7px;
    font-size: 12px;
}

.terra-reports-form-buttons {
    display: flex;
    gap: 10px;
}

.terra-reports-form-buttons button {
    border: 0;
    border-radius: 18px;
    background: #259e45;
    color: #fff;
    padding: 9px 18px;
    cursor: pointer;
    font-size: 12px;
}

.terra-reports-form-buttons button:disabled {
    opacity: .5;
    cursor: default;
}

.terra-reports-history-header,
.terra-report-history-row {
    display: grid;
    grid-template-columns:
        minmax(155px, 1.4fr)
        minmax(135px, 1fr)
        minmax(190px, 2fr)
        minmax(140px, 1.2fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 12px;
}

.terra-reports-history-header {
    background: #d3d3d3;
    border-radius: 5px;
    color: #555;
    margin-bottom: 8px;
}

.terra-report-history-item {
    margin-bottom: 7px;
}

.terra-report-history-row {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    color: #555;
    text-align: left;
    cursor: pointer;
}

.terra-report-history-row:hover {
    background: #f0fbf2;
}

.terra-report-history-row.is-open {
    border-left: 5px solid #239e47;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.terra-report-kind {
    color: #328e48;
}

.terra-report-state {
    display: inline-flex;
    gap: 5px;
}

.terra-report-state.is-success {
    color: #2b9450;
}

.terra-report-state.is-error {
    color: #c33;
}

.terra-report-state.is-pending {
    color: #777;
}

.terra-report-history-expanded {
    background: #fff;
    padding: 12px;
    border: 1px solid #239e47;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.terra-report-history-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.terra-report-history-actions a {
    display: inline-block;
    padding: 7px 13px;
    border: 1px solid #239e47;
    border-radius: 5px;
    margin-left: 8px;
    color: #19873b;
    text-decoration: none;
}

.terra-report-history-preview {
    display: block;
    width: 100%;
    height: 560px;
    max-height: 65vh;
    border: 1px solid #ccc;
    background: #fff;
}

.terra-reports-message,
.terra-reports-error,
.terra-reports-empty {
    padding: 12px;
    text-align: center;
}

.terra-reports-message {
    color: #278a41;
}

.terra-reports-error {
    color: #b33;
}

@media (max-width: 850px) {
    .terra-reports-history-header {
        display: none;
    }

    .terra-report-history-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 15px;
    }

    .terra-reports-tabs {
        gap: 4px;
    }

    .terra-reports-tab {
        flex: 1 1 auto;
    }
}


/* Terra Reports Position and Buyer Fix v1 */

.terra-reports-inline
.terra-reports-parameters {
    margin-top: 0;
    margin-bottom: 14px;
    margin-right: auto;
    box-sizing: border-box;
}

.terra-reports-inline
.terra-reports-parameters.is-reserves {
    margin-left: 0;
}

.terra-reports-inline
.terra-reports-parameters.is-card {
    margin-left: 165px;
}

.terra-reports-inline
.terra-reports-parameters.is-repair {
    margin-left: 325px;
}

.terra-reports-inline
.terra-reports-parameters input[readonly] {
    width: 100%;
    color: #555;
    background: #eeeeee;
    cursor: default;
}

@media (max-width: 850px) {
    .terra-reports-inline
    .terra-reports-parameters.is-reserves,

    .terra-reports-inline
    .terra-reports-parameters.is-card,

    .terra-reports-inline
    .terra-reports-parameters.is-repair {
        margin-left: 0;
    }
}


/* Terra Reports Customer Design v2 */

/* Вкладки */

.terra-reports-tabs {
    gap: 2px;
    margin-bottom: 5px;
    border-bottom: 2px solid #aaa;
}

.terra-reports-tab {
    padding: 8px 13px;
    font-size: 12px;
    line-height: 1.3;
    border-radius: 9px 9px 0 0;
    background: #bfbfbf;
    color: #626262;
    box-shadow: inset 0 1px rgba(255,255,255,.35);
}

.terra-reports-tab.is-active {
    background: #a6eab8;
    color: #177637;
    border-color: #29a34e;
}

/* Компактна форма */

.terra-reports-parameters {
    width: 310px;
    max-width: calc(100% - 10px);
    padding: 11px 13px;
    border-radius: 10px;
    box-shadow: none;
    margin-bottom: 14px;
}

.terra-reports-parameters.is-reserves {
    width: 310px;
    margin-left: 0;
}

.terra-reports-parameters.is-card {
    width: 325px;
    margin-left: 165px;
}

.terra-reports-parameters.is-repair {
    width: 325px;
    margin-left: 315px;
}

.terra-reports-parameters label {
    margin-bottom: 8px;
}

.terra-reports-parameters select,
.terra-reports-parameters input[type=date],
.terra-reports-parameters input[readonly] {
    font-size: 11px;
    padding: 5px 7px;
    min-height: 25px;
}

.terra-reports-form-buttons button {
    border-radius: 16px;
    padding: 7px 17px;
    font-size: 11px;
}

/* Заголовок історії */

.terra-reports-history-header,
.terra-report-history-row {
    grid-template-columns:
        minmax(150px, 1.35fr)
        minmax(140px, 1fr)
        minmax(180px, 2fr)
        minmax(140px, 1.1fr);
    gap: 0;
    padding: 7px 10px;
    font-size: 11px;
}

.terra-reports-history-header {
    border-radius: 5px;
    background: #cecece;
    color: #777;
    margin-bottom: 7px;
}

.terra-report-history-item {
    margin-bottom: 6px;
}

.terra-report-history-row {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 7px;
    min-height: 34px;
}

.terra-report-history-row.is-open {
    border-color: #e4e4e4;
    border-left: 0;
    border-radius: 8px 8px 0 0;
    background: #fff;
}

/* Зелена плашка активного звіту */

.terra-report-history-row.is-open
.terra-report-kind {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    width: fit-content;
    max-width: 100%;
    color: #fff;
    background: #239e47;
    padding: 0 24px 0 15px;
    border-radius: 9px 0 14px 0;
    clip-path: polygon(
        0 0,
        100% 0,
        calc(100% - 13px) 100%,
        0 100%
    );
    box-sizing: border-box;
    font-size: 11px;
}

.terra-report-history-row.is-open {
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0;
}

/* Блок сформованого звіту */

.terra-report-history-expanded {
    padding: 8px 11px 12px;
    border: 1px solid #e1e1e1;
    border-top: 0;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    background: #fff;
}

.terra-report-history-actions {
    margin-bottom: 7px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.terra-report-history-actions strong {
    font-size: 11px;
    color: #238b42;
}

.terra-report-history-actions a {
    padding: 4px 10px;
    margin-left: 5px;
    border: 0;
    background: transparent;
    color: #666;
    font-size: 11px;
}

/* Компактне вікно HTML-звіту */

.terra-report-preview-window {
    position: relative;
    height: 520px;
    max-height: 60vh;
    width: 100%;
    overflow: hidden;
    border: 1px solid #ddd;
    background: white;
}

.terra-report-history-preview {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    margin: 0;
    transform: none;
    background: white;
}

/* Мобільна версія */

@media (max-width: 850px) {
    .terra-reports-parameters.is-reserves,
    .terra-reports-parameters.is-card,
    .terra-reports-parameters.is-repair {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }

    .terra-report-preview-window {
        height: 460px;
    }

    .terra-report-history-preview {
        height: 766px;
    }
}


/* Terra Reports Wide Preview v3 */
.terra-report-preview-window {
    width: 100%;
    height: 520px;
    max-height: none;
    overflow: hidden;
    box-sizing: border-box;
}

@media (max-width: 850px) {
    .terra-report-preview-window {
        height: 460px;
    }
}


/* Terra Hide Facebook Login v1 */
button:has(.ti-facebook),
.p-button:has(.ti-facebook),
button:has(.pi-facebook),
.p-button:has(.pi-facebook) {
    display: none !important;
}
