.dbt-otp-wrap {
    max-width: 1280px;
    margin: 20px auto;
    padding: 0 12px;
    box-sizing: border-box;
}

.dbt-otp-wrap *,
.dbt-otp-wrap *::before,
.dbt-otp-wrap *::after {
    box-sizing: border-box;
}

.dbt-otp-card {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.dbt-otp-title {
    margin: 0 0 6px 0;
    font-size: 2rem;
    line-height: 1.15;
}

.dbt-otp-subtitle {
    margin: 0 0 18px 0;
    color: #555;
}

.dbt-otp-chooser {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.dbt-otp-role-btn {
    appearance: none;
    border: 1px solid #cfcfcf;
    background: #f6f6f6;
    color: #111;
    border-radius: 999px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.dbt-otp-role-btn:hover {
    opacity: 0.95;
}

.dbt-otp-role-btn.is-active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.dbt-otp-role-header {
    margin-bottom: 18px;
}

.dbt-otp-role-badge {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-weight: 700;
}

.dbt-otp-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.dbt-otp-grid.one {
    grid-template-columns: 1fr;
}

.dbt-otp-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dbt-otp-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dbt-otp-grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dbt-otp-grid label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.dbt-otp-wrap input[type="text"],
.dbt-otp-wrap input[type="password"],
.dbt-otp-wrap input[type="number"],
.dbt-otp-wrap input[type="date"],
.dbt-otp-wrap input[type="month"],
.dbt-otp-wrap input[type="email"],
.dbt-otp-wrap input[type="file"],
.dbt-otp-wrap select,
.dbt-otp-wrap textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cfcfcf;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    min-height: 44px;
}

.dbt-otp-wrap textarea {
    min-height: 90px;
    resize: vertical;
}

.dbt-otp-wrap input[disabled],
.dbt-otp-wrap input[readonly] {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

.dbt-otp-actions {
    margin-top: 6px;
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dbt-otp-actions.align-end {
    justify-content: flex-end;
    align-items: flex-end;
    height: 100%;
}

.dbt-otp-btn {
    appearance: none;
    border: 0;
    background: #111;
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.18s ease, transform 0.05s ease;
}

.dbt-otp-btn:hover {
    opacity: 0.92;
}

.dbt-otp-btn:active {
    transform: translateY(1px);
}

.dbt-otp-btn-secondary {
    background: #666;
}

.dbt-otp-admin-section {
    border-top: 1px solid #ececec;
    padding-top: 20px;
    margin-top: 18px;
}

.dbt-otp-admin-section:first-child {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.dbt-otp-checkbox-wrap {
    display: flex;
    align-items: center;
}

.dbt-otp-checkline {
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin-top: 24px;
}

.dbt-otp-checkline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    flex: 0 0 auto;
}

.dbt-otp-result-card {
    margin-top: 16px;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    padding: 18px;
    background: #fafafa;
}

.dbt-otp-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.dbt-otp-summary-grid > div {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 10px;
    padding: 12px;
}

.dbt-otp-section {
    margin-top: 20px;
    margin-bottom: 22px;
}

.dbt-otp-section h4 {
    margin-top: 0;
    margin-bottom: 8px;
}

.dbt-otp-line-item-card {
    border: 1px solid #e4e4e4;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    background: #fafafa;
}

.dbt-otp-line-item-card h4 {
    margin-top: 0;
    margin-bottom: 12px;
}

.dbt-otp-po-table,
.dbt-otp-line-items-table,
.dbt-otp-users-table,
.dbt-otp-supplier-dashboard-table {
    display: grid;
    gap: 8px 10px;
    align-items: start;
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 10px;
    padding: 12px;
}

.dbt-otp-po-table {
    grid-template-columns: 1.2fr 1fr 1.6fr 0.7fr 0.9fr 0.7fr;
}

.dbt-otp-supplier-dashboard-table {
    grid-template-columns: 1.2fr 1.8fr 1fr 0.7fr 0.9fr 0.7fr;
}

.dbt-otp-line-items-table-customer {
    grid-template-columns: 0.5fr 1.7fr 0.6fr 0.9fr;
}

.dbt-otp-line-items-table-supplier {
    grid-template-columns: 0.5fr 1.7fr 0.6fr 0.9fr 1fr 1fr 1fr;
}

.dbt-otp-users-table {
    grid-template-columns: 0.9fr 1.2fr 1fr 1.4fr 1.1fr 1.6fr 0.8fr 1.6fr;
}

.dbt-otp-po-head {
    font-weight: 700;
    color: #333;
    border-bottom: 1px solid #e7e7e7;
    padding-bottom: 6px;
}

.dbt-otp-users-table > div {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dbt-otp-user-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.dbt-otp-user-actions .dbt-otp-btn {
    padding: 10px 14px;
}

#dbt-otp-user-edit-wrap {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #ececec;
}

.dbt-otp-history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.dbt-otp-history-col h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.dbt-otp-history-item {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.dbt-otp-history-top {
    margin-bottom: 8px;
    font-weight: 700;
}

.dbt-otp-history-note {
    margin-bottom: 8px;
    color: #333;
}

.dbt-otp-history-meta {
    font-size: 0.9rem;
    color: #666;
}

.dbt-otp-legend {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 12px;
}

.dbt-otp-legend-gray {
    color: #8d8d8d;
    font-weight: 700;
}

.dbt-otp-legend-green {
    color: #15803d;
    font-weight: 700;
}

.dbt-otp-legend-red {
    color: #b00020;
    font-weight: 700;
}

.dbt-otp-month-wrap {
    margin-bottom: 24px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    overflow: hidden;
}

.dbt-otp-month-title {
    background: #111;
    color: #fff;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 1rem;
}

.dbt-otp-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.dbt-otp-month-head {
    background: #f7f7f7;
    border-bottom: 1px solid #e5e5e5;
}

.dbt-otp-day-head {
    padding: 10px;
    text-align: center;
    font-weight: 700;
    border-right: 1px solid #ececec;
}

.dbt-otp-day-head:last-child {
    border-right: 0;
}

.dbt-otp-day-cell {
    min-height: 125px;
    overflow: hidden;
    border-right: 1px solid #ececec;
    border-bottom: 1px solid #ececec;
    padding: 8px;
    background: #fff;
}

.dbt-otp-day-cell:nth-child(7n) {
    border-right: 0;
}

.dbt-otp-day-cell.is-empty {
    background: #fafafa;
}

.dbt-otp-click-day {
    cursor: pointer;
}

.dbt-otp-click-day:hover {
    background: #f5f8ff;
}

.dbt-otp-click-day.is-selected-day {
    background: #eef4ff;
    outline: 2px solid #5a7bd8;
    outline-offset: -2px;
}

.dbt-otp-drop-day.is-drop-target {
    background: #eef4ff;
    outline: 2px dashed #5a7bd8;
}

.dbt-otp-day-num {
    font-weight: 700;
    margin-bottom: 8px;
    color: #222;
}

.dbt-otp-day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dbt-otp-ship-badge {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    border-radius: 12px;
    padding: 4px 6px;
    border: 1px solid transparent;
    font-size: 0.72rem;
    line-height: 1.15;
    font-weight: 700;
    min-height: 0;
    width: 100%;
}

.dbt-otp-drag-shipment {
    cursor: grab;
}

.dbt-otp-drag-shipment:active {
    cursor: grabbing;
}

.dbt-otp-ship-badge.is-status-green {
    background: #16a34a !important;
    color: #fff !important;
}

.dbt-otp-ship-badge.is-gray {
    background: #6b7280 !important;
    color: #fff !important;
}

.dbt-otp-ship-badge.is-moved {
    background: #b45309 !important;
    color: #fff !important;
}

.dbt-otp-ship-badge.is-original-red {
    background: #b91c1c !important;
    color: #fff !important;
}

.dbt-otp-ship-label {
    display: block;
    width: 100%;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

#dbt-ot-status-menu {
    position: absolute !important;
    display: none;
    z-index: 999999 !important;
    min-width: 180px;
    padding: 10px;
    background: #fff !important;
    border: 1px solid #d9dfe7 !important;
    border-radius: 12px !important;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14) !important;
}

#dbt-ot-status-select {
    width: 100%;
    min-height: 40px;
    display: block !important;
    border-radius: 10px;
    border: 1px solid #cfd7e3 !important;
    padding: 8px 10px;
    background: #fff !important;
    color: #111 !important;
}

.dbt-otp-message {
    padding: 12px 14px;
    border-radius: 10px;
    margin-top: 10px;
    font-weight: 600;
}

.dbt-otp-message.success {
    background: #e8f7ec;
    border: 1px solid #bfe5c9;
    color: #146c2e;
}

.dbt-otp-message.error {
    background: #fdecec;
    border: 1px solid #f1b9b9;
    color: #9f1d1d;
}

.dbt-otp-error-list {
    margin: 8px 0 0 18px;
    padding: 0;
}

.dbt-otp-import-summary-card {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #dbe5ee;
    border-radius: 12px;
}

.dbt-otp-import-summary-card > div {
    background: #fff;
    border: 1px solid #e3ebf2;
    border-radius: 10px;
    padding: 10px 12px;
}

@media (max-width: 1100px) {
    .dbt-otp-grid.four,
    .dbt-otp-summary-grid,
    .dbt-otp-po-table,
    .dbt-otp-supplier-dashboard-table,
    .dbt-otp-line-items-table-customer,
    .dbt-otp-line-items-table-supplier,
    .dbt-otp-import-summary-card,
    .dbt-otp-users-table {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dbt-otp-grid.three,
    .dbt-otp-history-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .dbt-otp-grid.two,
    .dbt-otp-grid.three,
    .dbt-otp-grid.four,
    .dbt-otp-summary-grid,
    .dbt-otp-history-grid,
    .dbt-otp-po-table,
    .dbt-otp-supplier-dashboard-table,
    .dbt-otp-line-items-table-customer,
    .dbt-otp-line-items-table-supplier,
    .dbt-otp-users-table,
    .dbt-otp-import-summary-card,
    .dbt-otp-month-grid {
        grid-template-columns: 1fr;
    }

    .dbt-otp-card {
        padding: 16px;
    }

    .dbt-otp-title {
        font-size: 1.6rem;
    }

    .dbt-otp-day-head {
        display: none;
    }

    .dbt-otp-day-cell {
        min-height: auto;
    }

    .dbt-otp-actions.align-end {
        justify-content: flex-start;
        align-items: stretch;
        height: auto;
    }

    .dbt-otp-user-actions {
        flex-direction: column;
        align-items: stretch;
    }
}