.marketing-tree-panel {
    width: 320px;
    min-height: auto;
    box-sizing: border-box;
    margin: 20px 0 0 16px;
    padding: 18px;
    background: #1f2937;
    border: 1px solid #374151;
    border-left: 5px solid #ef4444;
    border-radius: 8px;
    color: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.2);
}

.marketing-tree {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.marketing-tree-panel .marketing-tree-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 38px;
    box-sizing: border-box;
    margin: 0;
    padding: 7px 10px;
    color: #f9fafb;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: none;
}

.marketing-tree-panel .marketing-tree-item:hover,
.marketing-tree-panel .marketing-tree-item:focus {
    background: #374151;
    color: #fff;
}

.marketing-tree-panel .marketing-tree-item.level-2 {
    width: calc(100% - 26px);
    margin-left: 26px;
    padding-left: 12px;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    border-left: 2px solid #ef4444;
    border-radius: 0 6px 6px 0;
}

.marketing-tree-panel .marketing-tree-item.customer {
    gap: 12px;
    margin-top: 4px;
}

.marketing-tree-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.marketing-tree-icon {
    position: relative;
    flex: 0 0 auto;
    box-sizing: border-box;
    color: #ef4444;
}

.marketing-tree-icon.document {
    width: 14px;
    height: 18px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0 3px,
            currentColor 3px 4px,
            transparent 4px 6px
        );
}

.marketing-tree-icon.briefcase {
    width: 18px;
    height: 14px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    margin-top: 3px;
}

.marketing-tree-icon.briefcase::before {
    content: "";
    position: absolute;
    left: 5px;
    top: -5px;
    width: 6px;
    height: 5px;
    border: 1.5px solid currentColor;
    border-bottom: 0;
    border-radius: 2px 2px 0 0;
}

.marketing-index {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.marketing-index-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.marketing-index-header h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
}

.marketing-index-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
}

.marketing-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #d9dee8;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.marketing-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.marketing-toolbar-label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.marketing-toolbar-center {
    flex: 1;
    min-width: 280px;
}

.marketing-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.marketing-search-form .search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd6e4;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.marketing-search-form .search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.marketing-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.marketing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.marketing-btn.primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.marketing-table-wrap {
    background: #fff;
    border: 1px solid #d9dee8;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.marketing-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.marketing-table th,
.marketing-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
    font-size: 13px;
}

.marketing-table th {
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.marketing-table tbody tr:hover {
    background: #f9fbff;
}

.marketing-table tbody tr:last-child td {
    border-bottom: none;
}

.marketing-table td.actions {
    white-space: nowrap;
}

.marketing-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #d9dee8;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.pagination-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

#currentPage {
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}

.marketing-pagination select {
    padding: 8px 10px;
    border: 1px solid #cfd6e4;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
}

.marketing-empty {
    text-align: center;
    padding: 24px 16px;
}

.enquiry-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.enquiry-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 2px;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
}

.enquiry-back {
    color: #111827;
    text-decoration: none;
    font-size: 20px;
    line-height: 1;
}

.enquiry-search {
    display: flex;
    width: min(820px, 100%);
}

.enquiry-search input {
    flex: 1;
    height: 31px;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1px solid #bfc4cc;
    border-right: none;
    font-size: 12px;
    font-style: italic;
    font-weight: 700;
    background: #fff;
}

.enquiry-search button {
    width: 48px;
    height: 31px;
    border: 1px solid #006fbf;
    background: #0070c0;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.enquiry-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 4px 0 2px;
    font-size: 12px;
    font-weight: 700;
}

.enquiry-date-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.enquiry-date-field input {
    width: 104px;
    height: 31px;
    box-sizing: border-box;
    padding: 5px 10px;
    border: 1px solid #bfc4cc;
    background: #fff;
    color: #111827;
    font-size: 12px;
}

.enquiry-date-field input:focus {
    border-color: #0070c0;
    outline: none;
}

.enquiry-filter-submit {
    height: 31px;
    padding: 5px 18px;
    border: 1px solid #006fbf;
    background: #0070c0;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.enquiry-filter-submit:hover,
.enquiry-filter-submit:focus {
    background: #005f9f;
    outline: none;
}

.enquiry-table-wrap {
    width: min(100%, 1120px);
    overflow-x: auto;
}

.enquiry-table {
    width: 100%;
    min-width: 820px;
    table-layout: fixed;
}

.enquiry-table th,
.enquiry-table td {
    height: 33px;
    box-sizing: border-box;
    vertical-align: middle;
}

.enquiry-table th {
    height: 42px;
    line-height: 1.15;
}

.enquiry-table .sort-col {
    width: 18px;
    padding: 0;
    text-align: center;
    font-size: 10px;
    line-height: 1;
}

.enquiry-table .col-enquiry-order {
    width: 13%;
}

.enquiry-table .col-enquiry-version,
.enquiry-table .col-buyer-name {
    width: 11%;
}

.enquiry-table .col-buyer-code {
    width: 12%;
}

.enquiry-table .col-final-price,
.enquiry-table .col-enquiry-status,
.enquiry-table .col-enquiry-conversion {
    width: 9%;
}

.enquiry-table .col-unit-price,
.enquiry-table .col-detail,
.enquiry-table .col-history {
    width: 6%;
}

.enquiry-table .col-enquiry-date {
    width: 10%;
}

.enquiry-table .col-print {
    width: 5%;
}

.enquiry-table .icon-col {
    text-align: center;
}

.cash-sales-table-wrap {
    width: min(100%, 1280px);
    overflow-x: auto;
}

.cash-sales-table {
    width: 100%;
    min-width: 1180px;
    table-layout: fixed;
}

.cash-sales-table th,
.cash-sales-table td {
    height: 33px;
    box-sizing: border-box;
    vertical-align: middle;
}

.cash-sales-table th {
    height: 42px;
    line-height: 1.15;
}

.cash-sales-table .sort-col {
    width: 18px;
    padding: 0;
    text-align: center;
    font-size: 10px;
    line-height: 1;
}

.cash-sales-table .col-cash-sales-order,
.cash-sales-table .col-cash-enquiry-order {
    width: 10%;
}

.cash-sales-table .col-cash-sales-version,
.cash-sales-table .col-cash-enquiry-version,
.cash-sales-table .col-cash-unit-price,
.cash-sales-table .col-cash-paid,
.cash-sales-table .col-cash-balance {
    width: 7%;
}

.cash-sales-table .col-cash-buyer-name,
.cash-sales-table .col-cash-buyer-code,
.cash-sales-table .col-cash-date {
    width: 9%;
}

.cash-sales-table .col-cash-final-price,
.cash-sales-table .col-cash-status,
.cash-sales-table .col-cash-conversion {
    width: 8%;
}

.cash-sales-table .col-detail,
.cash-sales-table .col-history,
.cash-sales-table .col-print {
    width: 5%;
}

.cash-sales-table .icon-col {
    text-align: center;
}

.receipt-table-wrap {
    width: min(100%, 1280px);
    overflow-x: auto;
}

.receipt-table {
    width: 100%;
    min-width: 1100px;
    table-layout: fixed;
}

.receipt-table th,
.receipt-table td {
    height: 33px;
    box-sizing: border-box;
    vertical-align: middle;
}

.receipt-table th {
    height: 42px;
    line-height: 1.15;
}

.receipt-table .sort-col {
    width: 18px;
    padding: 0;
    text-align: center;
    font-size: 10px;
    line-height: 1;
}

.receipt-table .col-receipt-order,
.receipt-table .col-receipt-cash-order {
    width: 11%;
}

.receipt-table .col-receipt-version,
.receipt-table .col-receipt-cash-version,
.receipt-table .col-receipt-unit-price,
.receipt-table .col-receipt-paid,
.receipt-table .col-receipt-balance {
    width: 8%;
}

.receipt-table .col-receipt-buyer-name,
.receipt-table .col-receipt-buyer-code,
.receipt-table .col-receipt-date {
    width: 10%;
}

.receipt-table .col-receipt-final-price {
    width: 9%;
}

.receipt-table .col-detail,
.receipt-table .col-history,
.receipt-table .col-print {
    width: 5%;
}

.receipt-table .icon-col {
    text-align: center;
}

.order-bill-table-wrap {
    width: min(100%, 1280px);
    overflow-x: auto;
}

.order-bill-table {
    width: 100%;
    min-width: 1180px;
    table-layout: fixed;
}

.order-bill-table th,
.order-bill-table td {
    height: 33px;
    box-sizing: border-box;
    vertical-align: middle;
}

.order-bill-table th {
    height: 42px;
    line-height: 1.15;
}

.order-bill-table .sort-col {
    width: 18px;
    padding: 0;
    text-align: center;
    font-size: 10px;
    line-height: 1;
}

.order-bill-table .col-order-bill-code,
.order-bill-table .col-order-receipt-order {
    width: 10%;
}

.order-bill-table .col-order-bill-version,
.order-bill-table .col-order-receipt-version,
.order-bill-table .col-order-unit-price,
.order-bill-table .col-order-paid,
.order-bill-table .col-order-balance {
    width: 7%;
}

.order-bill-table .col-order-buyer-name,
.order-bill-table .col-order-buyer-code,
.order-bill-table .col-order-date {
    width: 9%;
}

.order-bill-table .col-order-final-price,
.order-bill-table .col-order-status {
    width: 8%;
}

.order-bill-table .col-detail,
.order-bill-table .col-history,
.order-bill-table .col-print {
    width: 5%;
}

.order-bill-table .icon-col {
    text-align: center;
}

.customer-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.customer-table {
    width: 100%;
    min-width: 1548px;
    table-layout: fixed;
}

.customer-table th,
.customer-table td {
    height: 33px;
    box-sizing: border-box;
    padding: 10px 8px;
    vertical-align: middle;
}

.customer-table th {
    height: 42px;
    line-height: 1.15;
}

.customer-table .sort-col {
    width: 28px;
    padding: 0;
    text-align: center;
    font-size: 10px;
    line-height: 1;
}

.customer-table .col-customer-name {
    width: 125px;
}

.customer-table .col-customer-code {
    width: 125px;
}

.customer-table .col-customer-group {
    width: 110px;
}

.customer-table .col-customer-type {
    width: 110px;
}

.customer-table .col-customer-email {
    width: 180px;
}

.customer-table .col-customer-mobile {
    width: 125px;
}

.customer-table .col-customer-landline {
    width: 125px;
}

.customer-table .col-customer-address {
    width: 170px;
}

.customer-table .col-customer-title {
    width: 85px;
}

.customer-table .col-customer-city {
    width: 105px;
}

.customer-table .col-customer-postal {
    width: 115px;
}

.customer-table .col-customer-country {
    width: 100px;
}

.customer-table .col-detail,
.customer-table .col-print {
    width: 70px;
    text-align: center;
}

.customer-table th.col-detail,
.customer-table th.col-print {
    padding-left: 10px;
    padding-right: 10px;
    white-space: nowrap;
}

.customer-table td:nth-child(11) {
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
}

.customer-table td:nth-child(12),
.customer-table td:nth-child(13) {
    white-space: nowrap;
}

.customer-table .icon-col {
    text-align: center;
    padding-left: 10px;
    padding-right: 10px;
}

.customer-detail-page textarea {
    width: 100%;
    min-height: 70px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    background: #f8f8f8;
    color: #111827;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.35;
    resize: vertical;
    box-sizing: border-box;
}

.customer-detail-page textarea[readonly],
.customer-detail-page input[readonly] {
    color: #374151;
}

.customer-detail-page .enquiry-detail-table-wrap,
.customer-detail-page .enquiry-detail-accordions {
    width: min(100%, 1100px);
}

.customer-detail-page .enquiry-detail-section summary {
    min-width: 300px;
}

.customer-detail-actions {
    display: flex;
    justify-content: flex-end;
    max-width: 820px;
    margin: 16px auto 0;
}

.customer-detail-save {
    min-width: 76px;
    min-height: 30px;
    padding: 6px 16px;
    border: 1px solid #1d8ad8;
    background: #1d9bf0;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.customer-detail-alert {
    width: min(100%, 820px);
    padding: 10px 14px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 700;
}

.customer-detail-alert.success {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.customer-detail-alert.error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.customer-transaction-table-wrap {
    overflow-x: auto;
}

.customer-transaction-table {
    min-width: 920px;
}

.customer-transaction-table th,
.customer-transaction-table td {
    white-space: nowrap;
}
.enquiry-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #111827;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.enquiry-icon-btn .bi-pencil-square {
    color: #1f2937;
}

.enquiry-icon-btn .bi-eye-fill {
    color: #000;
}

.enquiry-icon-btn .bi-clock-history {
    color: #1f2937;
}

.order-item-thumb {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border: 1px solid #d1d5db;
    background: #f9fafb;
}

.enquiry-pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    font-size: 12px;
}

.enquiry-pages {
    display: inline-flex;
    align-items: center;
    gap: 13px;
}

.enquiry-page-num {
    color: #374151;
    text-decoration: none;
}

.enquiry-page-num.active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 20px;
    border: 1px solid #22a7f0;
    color: #2563eb;
}

.enquiry-page-size {
    height: 25px;
    border: 1px solid #d1d5db;
    color: #4b5563;
    background: #fff;
    font-size: 12px;
}

.enquiry-detail-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.enquiry-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.enquiry-detail-print {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    border: 1px solid #1f5e9d;
    background: #2f6da8;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.enquiry-detail-table-wrap {
    width: min(100%, 820px);
}

.enquiry-detail-table th {
    width: 190px;
    text-align: right;
}

.enquiry-detail-table td {
    font-weight: 700;
}

.enquiry-detail-accordions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(100%, 1000px);
    margin-top: 8px;
}

.enquiry-detail-section {
    border: 0;
}

.enquiry-detail-section summary {
    display: inline-flex;
    align-items: center;
    min-width: 260px;
    min-height: 28px;
    padding: 2px 8px;
    border: 2px solid transparent;
    border-radius: 4px;
    color: #000;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.enquiry-detail-section summary::-webkit-details-marker {
    display: none;
}

.enquiry-detail-section summary::before {
    content: ">";
    margin-right: 6px;
    font-weight: 700;
}

.enquiry-detail-section[open] summary {
    border-color: #111827;
}

.enquiry-detail-section[open] summary::before {
    content: "v";
}

.enquiry-detail-section-body {
    position: relative;
    margin-top: 8px;
    padding: 18px 24px;
    border: 1px solid #d9d9d9;
    background: #fff;
}

.enquiry-section-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.enquiry-sync-btn {
    min-width: 58px;
    min-height: 26px;
    border: 1px solid #d1d5db;
    background: #f8f8f8;
    color: #9ca3af;
    font-size: 12px;
    cursor: not-allowed;
}

.enquiry-link-btn {
    border: 0;
    background: transparent;
    color: #2f6da8;
    font-size: 12px;
    cursor: not-allowed;
}

.enquiry-add-btn {
    width: max-content;
    min-height: 28px;
    padding: 4px 14px;
    border: 1px solid #1d8ad8;
    background: #1d9bf0;
    color: #fff;
    font-size: 12px;
    cursor: not-allowed;
}

.enquiry-clause-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
}

.enquiry-clause-field input {
    border-right: 0;
}

.enquiry-clause-field button {
    border: 1px solid #d1d5db;
    background: #f8f8f8;
    color: #6b7280;
    cursor: not-allowed;
}

.enquiry-info-grid {
    display: grid;
    grid-template-columns: minmax(150px, 240px) minmax(260px, 1fr);
    gap: 8px 16px;
    align-items: center;
    max-width: 820px;
    margin: 0 auto;
}

.enquiry-info-grid label {
    margin: 0;
    text-align: right;
    font-size: 13px;
    color: #374151;
}

.enquiry-info-grid input,
.enquiry-info-grid select {
    width: 100%;
    min-height: 26px;
    padding: 3px 8px;
    border: 1px solid #d1d5db;
    background: #f8f8f8;
    color: #111827;
    font-size: 13px;
    box-sizing: border-box;
}

.enquiry-info-grid input[type="checkbox"] {
    width: 14px;
    min-height: 14px;
    justify-self: start;
}

.enquiry-inline-field {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 0;
}

.enquiry-inline-field input + input,
.enquiry-inline-field select + input {
    border-left: 0;
}

@media (max-width: 900px) {
    .marketing-toolbar,
    .marketing-index-header,
    .marketing-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .marketing-toolbar-left,
    .marketing-toolbar-right,
    .pagination-left {
        justify-content: space-between;
    }

    .marketing-table-wrap {
        overflow-x: auto;
    }

    .enquiry-filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .enquiry-detail-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .enquiry-detail-table th {
        width: 140px;
    }

    .enquiry-detail-section summary {
        width: 100%;
    }

    .enquiry-info-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        margin: 0;
    }

    .enquiry-info-grid label {
        text-align: left;
    }
}
