:root {
    --bg: radial-gradient(circle at 10% 10%, #ffe8ba 0%, #fff8e8 35%, #fffdf7 100%);
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #f1e6d2;
    --ok: #065f46;
    --error: #991b1b;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background: var(--bg);
    overflow: auto;
}

.bo-layout {
    width: min(1600px, 100%);
    margin: 0 auto;
    padding: 0.75rem;
    display: grid;
    gap: 0.75rem;
    min-height: 100vh;
    grid-template-rows: auto minmax(0, 1fr);
}

.bo-header {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 0.8rem;
    background: linear-gradient(135deg, #1f2937, #374151);
    color: #f8fafc;
}

.bo-header-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.bo-logo {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    object-fit: contain;
    border: 2px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.22);
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.bo-header h1 {
    margin: 0;
    font-size: 1.25rem;
}

.bo-header p {
    margin: 0.35rem 0 0;
    color: #d1d5db;
    font-size: 0.87rem;
}

.bo-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.bo-manager-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fef3c7;
}

.bo-pricing-rule-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fef3c7;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 999px;
    padding: 0.24rem 0.58rem;
    white-space: nowrap;
}

.bo-link-btn,
.bo-ghost-btn,
.bo-primary-btn,
.bo-reset-btn,
.bo-table button {
    border: 0;
    border-radius: 0.65rem;
    min-height: 36px;
    padding: 0.45rem 0.7rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font: inherit;
}

.bo-link-btn,
.bo-ghost-btn {
    background: rgba(229, 231, 235, 0.95);
    color: #1f2937;
}

.bo-primary-btn {
    background: #0f766e;
    color: #fff;
}

.bo-primary-btn:hover {
    background: #115e59;
}

.bo-card {
    --bo-col-width-order_code: 8.5rem;
    --bo-col-width-buyer_name: calc(10ch + 1rem);
    --bo-col-width-buyer_phone: calc(9ch + 1rem);
    --bo-col-width-color: 78px;
    --bo-col-width-size: 78px;
    --bo-col-width-status: 8rem;
    --bo-col-width-payment_received: 4.9rem;
    --bo-col-width-sms: 5.5rem;
    --bo-col-width-picked_up: 4.9rem;
    --bo-col-width-created_at: 4.9rem;
    --bo-col-width-updated_at: 4.7rem;
    --bo-col-width-manager: 10.5rem;
    --bo-col-width-actions: 11.5rem;
    --bo-search-width: 23rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 0.75rem;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.bo-title-row {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: center;
}

.bo-title-row h2 {
    margin: 0;
}

.bo-title-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.bo-pill {
    background: #fef3c7;
    color: #7c2d12;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-weight: 800;
}

.bo-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-top: 0.55rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.bo-summary-card {
    border: 1px solid #f2dfbe;
    border-radius: 0.8rem;
    padding: 0.6rem;
    background: #fffbf4;
    min-width: 150px;
}

.bo-summary-card h3 {
    margin: 0;
    font-size: 0.8rem;
    color: #9a3412;
}

.bo-summary-card p {
    margin: 0.25rem 0 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #1f2937;
}

.bo-summary-tags {
    margin-top: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.bo-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    background: #fef3c7;
    color: #7c2d12;
}

.bo-toolbar-row th {
    padding: 0.5rem 0.55rem;
    background: #fffaf2;
    top: 0;
    z-index: 5;
}

.bo-toolbar-row th.bo-status-filter-open {
    z-index: 12;
}

.bo-head-row th {
    top: var(--bo-toolbar-row-height, 50px);
    z-index: 4;
}

.bo-head-cell {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.bo-head-cell--with-filter select {
    width: 100%;
    min-height: 30px;
    border: 1px solid #d6d3d1;
    border-radius: 0.55rem;
    padding: 0.3rem 0.4rem;
    background: #ffffff;
    font: inherit;
    font-size: 0.74rem;
    color: #4b5563;
}

.bo-header-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
    align-items: end;
}

.bo-header-toolbar__filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.45rem;
    align-items: end;
    flex: 1 1 460px;
}

.bo-header-control {
    display: grid;
    gap: 0.18rem;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 800;
    color: #6b7280;
}

.bo-header-control input,
.bo-header-control select {
    min-height: 32px;
    border: 1px solid #d6d3d1;
    border-radius: 0.55rem;
    padding: 0.38rem 0.5rem;
    background: #ffffff;
    font: inherit;
}

.bo-status-filter {
    position: relative;
}

.bo-status-filter__trigger {
    width: 100%;
    min-height: 32px;
    border: 1px solid #d6d3d1;
    border-radius: 0.55rem;
    padding: 0.38rem 1.8rem 0.38rem 0.5rem;
    background: #d5d5d5;
    font: inherit;
    color: #4b5563;
    text-align: left;
    cursor: pointer;
    position: relative;
}

.bo-status-filter__trigger::after {
    content: '▾';
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
}

.bo-status-filter__menu {
    position: absolute;
    top: calc(100% + 0.32rem);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d6d3d1;
    border-radius: 0.65rem;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
    padding: 0.4rem;
    z-index: 20;
}

.bo-status-filter__option {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #4b5563;
    padding: 0.24rem 0.18rem;
    cursor: pointer;
}

.bo-status-filter__option input {
    margin: 0;
    min-height: auto;
}

.bo-header-control--search {
    width: min(100%, var(--bo-search-width));
    min-width: min(260px, 100%);
    flex: 0 1 var(--bo-search-width);
}

.bo-header-control--select {
    min-width: 180px;
}

.bo-header-control--compact {
    min-width: 0;
    flex: 1 1 0;
}

.bo-columns {
    margin-top: 0.35rem;
    padding: 0.32rem 0.45rem;
    border: 1px dashed #f1cc95;
    border-radius: 0.75rem;
    background: #fffaf2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    align-items: center;
}

.bo-columns-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.bo-reset-btn {
    min-height: 26px;
    padding: 0.15rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.72rem;
    font-weight: 800;
    background: #1f2937;
    color: #f9fafb;
}

.bo-reset-btn:hover {
    background: #111827;
}

.bo-column-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: #374151;
}

.bo-column-toggle input {
    width: auto;
    min-height: auto;
}

.bo-message {
    margin: 0.55rem 0 0;
    min-height: 1.2rem;
    font-weight: 700;
}

.bo-message.success {
    color: var(--ok);
}

.bo-message.error {
    color: var(--error);
}

.bo-table-wrap {
    margin-top: 0.65rem;
    overflow: auto;
    flex: 1 1 auto;
    border: 1px solid #e7dcc9;
    border-radius: 0.75rem;
    max-height: clamp(360px, 62vh, 760px);
    min-height: 320px;
    background: #fff;
}

.bo-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 67rem;
    font-size: 0.82rem;
    --bo-toolbar-row-height: 50px;
    --bo-sticky-col-1-width: var(--bo-col-width-order_code);
    --bo-sticky-col-2-width: var(--bo-col-width-buyer_name);
    --bo-sticky-col-3-width: var(--bo-col-width-buyer_phone);
}

.bo-table .bo-col-order_code { min-width: 8.5rem; width: var(--bo-col-width-order_code); }
.bo-table .bo-col-buyer_name { min-width: calc(10ch + 1rem); width: var(--bo-col-width-buyer_name); }
.bo-table .bo-col-buyer_phone { min-width: calc(9ch + 1rem); width: var(--bo-col-width-buyer_phone); }
.bo-table .bo-col-color { min-width: 78px; width: var(--bo-col-width-color); }
.bo-table .bo-col-size { min-width: 78px; width: var(--bo-col-width-size); }
.bo-table .bo-col-status { min-width: 8rem; width: var(--bo-col-width-status); }
.bo-table .bo-col-payment_received { min-width: 4.9rem; width: var(--bo-col-width-payment_received); }
.bo-table .bo-col-sms { min-width: 5.5rem; width: var(--bo-col-width-sms); }
.bo-table .bo-col-picked_up { min-width: 4.9rem; width: var(--bo-col-width-picked_up); }
.bo-table .bo-col-created_at { min-width: 4.9rem; width: var(--bo-col-width-created_at); }
.bo-table .bo-col-updated_at { min-width: 4.7rem; width: var(--bo-col-width-updated_at); }
.bo-table .bo-col-manager { min-width: 10.5rem; width: var(--bo-col-width-manager); }
.bo-table .bo-col-actions { min-width: 11.5rem; width: var(--bo-col-width-actions); }

.bo-table th,
.bo-table td {
    border-bottom: 1px solid #eee4d1;
    padding: 0.45rem 0.5rem;
    text-align: left;
    vertical-align: top;
}

.bo-table td.bo-col-color,
.bo-table td.bo-col-size,
.bo-table td.bo-col-status,
.bo-table td.bo-col-manager {
    text-align: center;
}

.bo-table td.bo-col-payment_received,
.bo-table td.bo-col-sms,
.bo-table td.bo-col-picked_up,
.bo-table td.bo-col-created_at,
.bo-table td.bo-col-updated_at {
    text-align: right;
}

.bo-table th.bo-col-payment_received,
.bo-table th.bo-col-sms,
.bo-table th.bo-col-picked_up,
.bo-table th.bo-col-created_at,
.bo-table th.bo-col-updated_at {
    text-align: right;
}

.bo-table th.bo-col-manager {
    text-align: center;
}

.bo-table th.bo-col-payment_received .bo-sort-trigger,
.bo-table th.bo-col-sms .bo-sort-trigger,
.bo-table th.bo-col-picked_up .bo-sort-trigger,
.bo-table th.bo-col-created_at .bo-sort-trigger,
.bo-table th.bo-col-updated_at .bo-sort-trigger {
    justify-content: flex-end;
    text-align: right;
}

.bo-table th.bo-col-manager .bo-sort-trigger {
    justify-content: center;
    text-align: center;
}

.bo-table .bo-col-payment_received,
.bo-table .bo-col-sms,
.bo-table .bo-col-picked_up,
.bo-table .bo-col-created_at,
.bo-table .bo-col-updated_at {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    white-space: nowrap;
}

.bo-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fffbf4;
    color: #92400e;
    font-weight: 800;
}

.bo-table .bo-toolbar-row th {
    top: 0;
}

.bo-table .bo-head-row th {
    top: var(--bo-toolbar-row-height, 50px);
}

.bo-sort-trigger {
    width: 100%;
    min-height: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 800;
    text-align: left;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.bo-sort-trigger::after {
    content: '↕';
    font-size: 0.72rem;
    opacity: 0.55;
}

.bo-sort-trigger.is-active::after {
    opacity: 1;
}

.bo-sort-trigger.is-asc::after {
    content: '↑';
}

.bo-sort-trigger.is-desc::after {
    content: '↓';
}

.bo-table .bo-col-hidden {
    display: none;
}

.bo-table .bo-sticky {
    position: sticky;
    z-index: 2;
    background: #fffdfa;
}

.bo-table th.bo-sticky {
    z-index: 4;
    background: #fff7ed;
}

.bo-table .bo-sticky-1 {
    left: 0;
    width: var(--bo-sticky-col-1-width);
    min-width: var(--bo-sticky-col-1-width);
}

.bo-table .bo-sticky-2 {
    left: var(--bo-sticky-col-1-width);
    width: var(--bo-sticky-col-2-width);
    min-width: var(--bo-sticky-col-2-width);
}

.bo-table .bo-sticky-3 {
    left: calc(var(--bo-sticky-col-1-width) + var(--bo-sticky-col-2-width));
    width: var(--bo-sticky-col-3-width);
    min-width: var(--bo-sticky-col-3-width);
    border-right: 1px solid #f1e2ca;
    box-shadow: 10px 0 14px -10px rgba(146, 64, 14, 0.5);
}

.bo-table tbody tr:hover {
    background: #fffcf8;
}

.bo-table tbody tr:hover .bo-sticky {
    background: #fffcf8;
}

.bo-group-row td {
    background: #fff7ed;
    color: #9a3412;
    font-weight: 800;
    border-bottom-color: #fdba74;
}

.bo-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.bo-status.is-pending {
    background: #fef3c7;
    color: #92400e;
}

.bo-status.is-confirmed {
    background: #dbeafe;
    color: #1e40af;
}

.bo-status.is-picked_up {
    background: #ccfbf1;
    color: #115e59;
}

.bo-status.is-canceled {
    background: #fee2e2;
    color: #991b1b;
}

.bo-actions {
    display: inline-flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.bo-actions button {
    min-height: 30px;
    padding: 0.25rem 0.55rem;
    border-radius: 0.5rem;
    font-size: 0.72rem;
    color: #fff;
}

.bo-actions .edit {
    background: #1f2937;
}

.bo-actions .payment {
    background: #2563eb;
}

.bo-actions .payment:hover {
    background: #1d4ed8;
}

.bo-actions .message {
    background: #16a34a;
}

.bo-actions .message:hover {
    background: #15803d;
}

.bo-actions .pickup {
    background: #0f766e;
}

.bo-actions .cancel {
    background: #b91c1c;
}

.bo-actions button:disabled {
    background: #9ca3af;
    color: #374151;
    cursor: not-allowed;
}

.bo-note-row td {
    border-bottom: 1px solid #f2e8d7;
    background: #fffdfa;
    padding-top: 0.18rem;
    padding-bottom: 0.4rem;
}

.bo-note-row .bo-note-cell {
    font-size: 0.71rem;
    line-height: 1.25;
    font-weight: 700;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bo-rowspan-cell {
    vertical-align: middle;
}

.confirmation-channel-dialog__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.action-icon {
    font-size: 0.95em;
    line-height: 1;
}

.confirmation-channel-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
}

.confirmation-channel-dialog {
    border: none;
    border-radius: 1rem;
    padding: 0;
    width: min(92vw, 500px);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
}

.confirmation-channel-dialog__panel {
    padding: 1.1rem;
    background: #fff;
    border-radius: 1rem;
}

.confirmation-channel-dialog__eyebrow {
    margin: 0 0 0.3rem;
    color: #2563eb;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.confirmation-channel-dialog__panel h2 {
    margin: 0;
    font-size: 1.2rem;
}

.confirmation-channel-dialog__description {
    margin: 0.55rem 0 0;
    color: #4b5563;
    font-size: 0.92rem;
}

.confirmation-channel-dialog__amount {
    margin: 0.6rem 0 0;
    color: #92400e;
    font-size: 0.9rem;
    font-weight: 800;
}

.confirmation-channel-dialog__note-label {
    display: block;
    margin-top: 0.7rem;
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 800;
}

.confirmation-channel-dialog__note {
    width: 100%;
    margin-top: 0.35rem;
    border: 1px solid #d6d3d1;
    border-radius: 0.65rem;
    padding: 0.5rem 0.6rem;
    font: inherit;
    resize: vertical;
    min-height: 84px;
}

.bo-edit-dialog-grid {
    display: grid;
    gap: 0.25rem;
    margin-top: 0.4rem;
}

.bo-edit-dialog-control {
    width: 100%;
    margin-top: 0.2rem;
    border: 1px solid #d6d3d1;
    border-radius: 0.65rem;
    padding: 0.5rem 0.6rem;
    font: inherit;
    min-height: 40px;
    background: #fff;
}

.bo-provider-summary-list {
    margin-top: 0.65rem;
    max-height: 310px;
    overflow: auto;
    border: 1px solid #e7dcc9;
    border-radius: 0.7rem;
    padding: 0.5rem 0.6rem;
    background: #fffaf2;
}

.bo-provider-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    color: #374151;
}

.bo-provider-summary-table th,
.bo-provider-summary-table td {
    border: 1px solid #eadcc2;
    padding: 0.32rem 0.38rem;
    text-align: center;
}

.bo-provider-summary-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff2dd;
    color: #92400e;
    font-weight: 800;
}

.bo-provider-summary-table tbody th {
    background: #fff9ee;
    color: #7c2d12;
    font-weight: 800;
}

.bo-provider-summary-row-total {
    font-weight: 800;
    color: #92400e;
    background: #fff9ee;
}

.bo-provider-summary-totals-row th,
.bo-provider-summary-column-total,
.bo-provider-summary-grand-total {
    font-weight: 800;
    color: #7c2d12;
    background: #ffefcf;
}

.bo-provider-summary-empty {
    margin: 0;
    font-size: 0.82rem;
    color: #6b7280;
}

.bo-provider-summary-actions {
    margin-top: 0.85rem;
}

.confirmation-channel-dialog__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.confirmation-channel-dialog__actions.is-single-channel {
    grid-template-columns: minmax(0, 1fr);
}

.confirmation-channel-dialog__button,
.confirmation-channel-dialog__close {
    min-height: 42px;
    border-radius: 0.8rem;
    font-weight: 800;
}

.confirmation-channel-dialog__button--sms {
    background: #2563eb;
}

.confirmation-channel-dialog__button--sms:hover {
    background: #1d4ed8;
}

.confirmation-channel-dialog__button--whatsapp {
    background: #16a34a;
}

.confirmation-channel-dialog__button--whatsapp:hover {
    background: #15803d;
}

.confirmation-channel-dialog__button--pending {
    background: #374151;
}

.confirmation-channel-dialog__button--pending:hover {
    background: #1f2937;
}

.confirmation-channel-dialog__close {
    width: 100%;
    margin-top: 0.65rem;
    background: #e5e7eb;
    color: #1f2937;
}

.hidden {
    display: none;
}

@media (max-width: 1100px) {
    .bo-header-toolbar__filters {
        flex-wrap: wrap;
    }
}

@media (max-width: 760px) {
    .bo-layout {
        padding: 0.75rem;
        height: auto;
        max-height: none;
        grid-template-rows: none;
    }

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

    .bo-card {
        display: block;
        overflow: visible;
    }

    .bo-toolbar-row th,
    .bo-head-row th {
        position: static;
    }

    .bo-table .bo-sticky {
        position: static;
        min-width: auto;
        box-shadow: none;
        border-right: 0;
    }
}
