.bwtr-panel {
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #fff;
    padding: 14px;
    margin: 12px 0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.bwtr-panel h2 {
    margin-top: 0;
}

.bwtr-muted {
    color: #64748b;
    font-size: 12px;
}

/* ============================================================
   Client: compact strip on the product details page
   ============================================================ */
.bwtr-strip {
    --bwtr-accent: #0f62fe;
    --bwtr-accent-soft: #eff6ff;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #fff;
    margin: 16px 0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.bwtr-strip:hover {
    border-color: var(--bwtr-accent);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.bwtr-strip.is-locked {
    --bwtr-accent: #94a3b8;
    --bwtr-accent-soft: #f1f5f9;
}

.bwtr-strip.is-free {
    --bwtr-accent: #16a34a;
    --bwtr-accent-soft: #dcfce7;
}

.bwtr-strip-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
    background: var(--bwtr-accent-soft);
    color: var(--bwtr-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    animation: bwtr-spin-soft 8s linear infinite;
}

.bwtr-strip.is-locked .bwtr-strip-icon {
    animation: none;
}

@keyframes bwtr-spin-soft {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.bwtr-strip-body {
    flex: 1 1 auto;
    min-width: 0;
}

.bwtr-strip-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.bwtr-strip-status {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--bwtr-accent-soft);
    color: var(--bwtr-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.bwtr-strip-headline {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    color: #0f172a;
}

.bwtr-strip-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--bwtr-accent);
}

.bwtr-strip-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--bwtr-accent-soft);
    color: var(--bwtr-accent);
    font-size: 12px;
    font-weight: 700;
}

.bwtr-strip-meta,
.bwtr-strip-meta-inline {
    color: #64748b;
    font-size: 12px;
}

.bwtr-strip-cta {
    flex: 0 0 auto;
}

.bwtr-strip-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--bwtr-accent);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
    transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.bwtr-strip-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.16);
    color: #fff !important;
}

.bwtr-strip-action-ghost {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569 !important;
    box-shadow: none;
}

.bwtr-strip-action-ghost:hover {
    border-color: var(--bwtr-accent);
    color: var(--bwtr-accent) !important;
}

@media (max-width: 640px) {
    .bwtr-strip {
        flex-wrap: wrap;
    }
    .bwtr-strip-cta {
        width: 100%;
    }
    .bwtr-strip-action {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   Client: standalone portal page
   ============================================================ */
.bwtr-portal {
    display: grid;
    gap: 14px;
    margin: 6px 0 24px;
}

.bwtr-portal-head {
    padding: 18px 20px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.bwtr-portal-back-link {
    display: inline-flex;
    align-items: center;
    margin: 0 0 10px;
    padding: 4px 10px 4px 8px;
    border-radius: 999px;
    background: rgba(15, 98, 254, 0.08);
    color: #0f62fe !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 140ms ease, transform 140ms ease;
}

.bwtr-portal-back-link:hover {
    background: rgba(15, 98, 254, 0.16);
    transform: translateX(-2px);
    color: #0043ce !important;
    text-decoration: none !important;
}

.bwtr-portal-headline {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.bwtr-portal-headline h2 {
    margin: 0;
    font-size: 22px;
    color: #0f172a;
}

.bwtr-portal-headline-only {
    margin: 0 0 12px;
    font-size: 22px;
    color: #0f172a;
}

.bwtr-portal-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
}

.bwtr-portal-state.is-available {
    background: #dcfce7;
    color: #15803d;
}

.bwtr-portal-state.is-free {
    background: #fef3c7;
    color: #b45309;
}

.bwtr-portal-state.is-locked {
    background: #fee2e2;
    color: #b91c1c;
}

.bwtr-portal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: bwtr-pulse 1.6s ease-in-out infinite;
}

.bwtr-portal-state.is-locked .bwtr-portal-dot {
    animation: none;
}

@keyframes bwtr-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.bwtr-portal-subtitle {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 13px;
}

.bwtr-portal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 14px;
}

@media (max-width: 800px) {
    .bwtr-portal-grid {
        grid-template-columns: 1fr;
    }
}

.bwtr-action-panel,
.bwtr-info-panel,
.bwtr-history-panel {
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #fff;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.bwtr-panel-title {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
}

.bwtr-action-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 6px;
}

.bwtr-action-tag-paid {
    background: #dbeafe;
    color: #1d4ed8;
}

.bwtr-action-tag-free {
    background: #fef3c7;
    color: #b45309;
}

.bwtr-action-tag-locked {
    background: #fee2e2;
    color: #b91c1c;
}

.bwtr-action-price {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    margin: 8px 0 6px;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.bwtr-action-price-muted {
    color: #94a3b8;
}

.bwtr-action-price .bwtr-action-tag {
    font-size: 11px;
    margin: 0;
    align-self: center;
}

.bwtr-action-hint {
    margin: 0 0 16px;
    color: #475569;
    font-size: 13px;
    line-height: 1.6;
}

.bwtr-button {
    appearance: none;
    border: 0;
    border-radius: 8px;
    background: #0f62fe;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 11px 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
    box-shadow: 0 1px 3px rgba(15, 98, 254, 0.3);
}

.bwtr-button:hover {
    background: #0043ce;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 98, 254, 0.32);
}

.bwtr-button:active {
    transform: translateY(0);
}

.bwtr-button-arrow {
    transition: transform 160ms ease;
}

.bwtr-button:hover .bwtr-button-arrow {
    transform: translateX(3px);
}

.bwtr-button-disabled,
.bwtr-button:disabled {
    background: #cbd5e1;
    color: #fff;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.bwtr-button-disabled:hover {
    background: #cbd5e1;
    transform: none;
    box-shadow: none;
}

.bwtr-submit.is-loading .bwtr-button {
    opacity: 0.65;
    pointer-events: none;
    background: #0043ce;
}

.bwtr-submit.is-loading .bwtr-button-arrow {
    animation: bwtr-spin 800ms linear infinite;
}

@keyframes bwtr-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Info panel */
.bwtr-info-list {
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
}

.bwtr-info-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
}

.bwtr-info-row:last-child {
    border-bottom: 0;
}

.bwtr-info-row dt {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    margin: 0;
}

.bwtr-info-row dd {
    color: #0f172a;
    font-size: 13px;
    margin: 0;
    word-break: break-word;
}

.bwtr-info-note {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 12px;
    color: #475569;
}

.bwtr-mini-pill {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
}

.bwtr-mini-pill.is-ok {
    background: #dcfce7;
    color: #15803d;
}

.bwtr-mini-pill.is-warn {
    background: #fef3c7;
    color: #b45309;
}

.bwtr-mini-pill.is-bad {
    background: #fee2e2;
    color: #b91c1c;
}

.bwtr-mini-pill.is-muted {
    background: #e2e8f0;
    color: #475569;
}

/* History */
.bwtr-history-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.bwtr-history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.bwtr-history-table th {
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.bwtr-history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.bwtr-history-table tr:last-child td {
    border-bottom: 0;
}

.bwtr-history-table tbody tr:hover td {
    background: #f8fbff;
}

.bwtr-history-time {
    color: #475569;
    font-feature-settings: "tnum";
    white-space: nowrap;
}

.bwtr-history-note {
    color: #64748b;
    font-size: 12px;
    max-width: 360px;
}

.bwtr-ref-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.bwtr-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
}

.bwtr-tag.is-ok {
    background: #dcfce7;
    color: #15803d;
}

.bwtr-tag.is-bad {
    background: #fee2e2;
    color: #b91c1c;
}

.bwtr-tag.is-pending {
    background: #fef3c7;
    color: #b45309;
}

.bwtr-tag.is-processing {
    background: #dbeafe;
    color: #1d4ed8;
}

.bwtr-tag.is-paid {
    background: #dbeafe;
    color: #1d4ed8;
}

.bwtr-tag.is-free {
    background: #fef3c7;
    color: #b45309;
}

.bwtr-empty-card {
    text-align: center;
    padding: 48px 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.bwtr-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #94a3b8;
}

.bwtr-empty-card h3 {
    margin: 0 0 6px;
    color: #0f172a;
}

.bwtr-empty-card p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.bwtr-empty-inline {
    padding: 28px;
    text-align: center;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
}

.bwtr-portal-back {
    margin: 8px 0 0;
    text-align: center;
}

/* ============================================================
   Toast & Modal
   ============================================================ */
.bwtr-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    margin: 0 0 12px;
    font-size: 13px;
    border: 1px solid;
    animation: bwtr-toast-in 240ms ease both;
    position: relative;
}

@keyframes bwtr-toast-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.bwtr-toast.is-leaving {
    animation: bwtr-toast-out 200ms ease both;
}

@keyframes bwtr-toast-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-6px); }
}

.bwtr-toast-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.bwtr-toast-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.bwtr-toast-icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: currentColor;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.bwtr-toast-success .bwtr-toast-icon { background: #15803d; }
.bwtr-toast-error .bwtr-toast-icon { background: #b91c1c; }

.bwtr-toast-text {
    flex: 1 1 auto;
    color: inherit;
    line-height: 1.5;
}

.bwtr-toast-close {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    transition: opacity 120ms ease, background 120ms ease;
}

.bwtr-toast-close:hover {
    opacity: 1;
    background: rgba(15, 23, 42, 0.06);
}

.bwtr-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    animation: bwtr-modal-fade 180ms ease both;
    backdrop-filter: blur(2px);
}

@keyframes bwtr-modal-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bwtr-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.4);
    animation: bwtr-modal-pop 220ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
    overflow: hidden;
}

@keyframes bwtr-modal-pop {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.bwtr-modal-head {
    padding: 20px 22px 4px;
}

.bwtr-modal-head h4 {
    margin: 0;
    color: #0f172a;
    font-size: 17px;
}

.bwtr-modal-body {
    padding: 8px 22px 22px;
    color: #475569;
    line-height: 1.6;
    font-size: 14px;
}

.bwtr-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 18px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.bwtr-modal-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 9px 16px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.bwtr-modal-btn-cancel {
    background: #fff;
    color: #475569;
    border-color: #cbd5e1;
}

.bwtr-modal-btn-cancel:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.bwtr-modal-btn-confirm {
    background: #0f62fe;
    color: #fff;
}

.bwtr-modal-btn-confirm:hover {
    background: #0043ce;
}

.bwtr-admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.bwtr-admin-table th,
.bwtr-admin-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 7px 8px;
    vertical-align: top;
    font-size: 13px;
}

.bwtr-admin h1 {
    margin-bottom: 12px;
}

/* .bwtr-tabs styling is handled by .bwui-tabs in bw_ui.css */

.bwtr-alert {
    border-radius: 6px;
    padding: 10px 12px;
    margin: 10px 0;
}

.bwtr-alert-success {
    background: #dcfce7;
    color: #166534;
}

.bwtr-alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.bwtr-filter,
.bwtr-grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.bwtr-filter input,
.bwtr-filter select,
.bwtr-grid-form input,
.bwtr-grid-form select,
.bwtr-admin-table input,
.bwtr-admin-table select {
    width: 100%;
    min-height: 32px;
}

.bwtr-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bwtr-check input {
    width: auto;
}

.bwtr-currency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.bwtr-currency-cell {
    display: flex;
    align-items: stretch;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    min-height: 34px;
    margin: 0;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.bwtr-currency-cell:focus-within {
    border-color: var(--bwui-primary, #0f62fe);
    box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.12);
}

.bwtr-currency-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: #eef2f7;
    color: #1e293b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-right: 1px solid #cbd5e1;
    min-width: 52px;
    user-select: none;
}

.bwtr-currency-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 5px 9px;
    font-size: 13px;
    text-align: right;
    outline: 0 !important;
    min-height: 32px !important;
    font-feature-settings: "tnum";
}

.bwtr-currency-input:focus {
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

/* Product rules: card-based layout */
.bwtr-product-filter {
    display: flex;
    align-items: end;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.bwtr-product-filter > .bwui-field {
    flex: 1 1 280px;
    max-width: 480px;
}

.bwtr-product-filter > button {
    height: 36px;
}

.bwtr-product-list {
    display: grid;
    gap: 10px;
}

/* Group-level controls + collapsible product groups */
.bwtr-product-grouptools {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin: -4px 0 8px;
}

.bwtr-product-group {
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #f8fafc;
    overflow: hidden;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.bwtr-product-group[open] {
    border-color: #bfdbfe;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    background: #fff;
}

.bwtr-product-group-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    list-style: none;
    cursor: pointer;
    user-select: none;
    transition: background 120ms ease;
}

.bwtr-product-group-summary::-webkit-details-marker {
    display: none;
}

.bwtr-product-group-summary:hover {
    background: #eff6ff;
}

.bwtr-product-group[open] .bwtr-product-group-summary {
    background: #f5f9ff;
    border-bottom: 1px solid #e2e8f0;
}

.bwtr-product-group-caret {
    color: #94a3b8;
    font-size: 13px;
    transition: transform 160ms ease;
    width: 14px;
    text-align: center;
    flex: 0 0 14px;
}

.bwtr-product-group[open] .bwtr-product-group-caret {
    transform: rotate(90deg);
    color: #0f62fe;
}

.bwtr-product-group-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bwtr-product-group-meta {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    flex: 0 0 auto;
    font-feature-settings: "tnum";
}

.bwtr-product-group-body {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
}

.bwtr-product-group-body .bwtr-product-card {
    background: #fff;
}

.bwtr-empty {
    padding: 28px;
    text-align: center;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

.bwtr-product-card {
    display: grid;
    gap: 12px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
    padding: 14px 16px;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.bwtr-product-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.bwtr-product-head {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e2e8f0;
}

.bwtr-product-title {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.bwtr-product-title strong {
    font-size: 15px;
    color: #0f172a;
    font-weight: 700;
}

.bwtr-product-title .bwtr-muted {
    font-size: 12px;
    color: #64748b;
}

.bwtr-product-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    align-items: center;
}

.bwtr-product-body {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 16px 22px;
    align-items: start;
}

.bwtr-product-grid {
    display: grid;
    grid-template-columns: minmax(160px, 200px) minmax(120px, 160px) 1fr;
    gap: 10px 12px;
}

.bwtr-product-currencies {
    display: grid;
    gap: 6px;
}

.bwtr-product-foot {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

/* AJAX submit button transient states */
.bwui-button.bwtr-btn-success,
.btn.bwtr-btn-success {
    background: #15803d !important;
    border-color: #15803d !important;
    color: #fff !important;
    transition: background 200ms ease, border-color 200ms ease;
}

.bwui-button.bwtr-btn-error,
.btn.bwtr-btn-error {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #fff !important;
    transition: background 200ms ease, border-color 200ms ease;
}

.bwui-button.is-loading,
.btn.is-loading {
    opacity: 0.85;
    cursor: progress;
}

@media (max-width: 1100px) {
    .bwtr-product-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .bwtr-product-grid {
        grid-template-columns: 1fr;
    }
}

/* Legacy .bwtr-pagination styles replaced by .bwtr-pagination-bar (admin-prefixed). */

.bwtr-inline-form {
    display: inline-block;
    margin: 0;
}

/* Admin table cells: ranges, stacks, pills, actions */
.bwtr-col-actions,
td.bwtr-col-actions {
    text-align: right !important;
    white-space: nowrap;
    width: 1%;
}

.bwtr-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bwtr-cell-stack strong {
    color: #0f172a;
    font-weight: 700;
    font-size: 13px;
}

.bwtr-cell-empty {
    color: #cbd5e1;
    font-weight: 700;
}

.bwtr-range {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #334155;
    font-feature-settings: "tnum";
    white-space: nowrap;
}

.bwtr-range-arrow {
    color: #94a3b8;
    font-size: 11px;
}

.bwtr-range-val {
    color: #1e293b;
}

.bwtr-pname-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.bwtr-pname {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
}

.bwtr-pname-more {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    cursor: help;
}

.bwtr-muted-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.bwtr-icon-btn.is-resume {
    color: #15803d !important;
    border-color: #bbf7d0 !important;
    background: #f0fdf4 !important;
}

.bwtr-icon-btn.is-resume:hover {
    color: #fff !important;
    background: #15803d !important;
    border-color: #15803d !important;
}

.bwtr-rule-value {
    display: inline-block;
    padding: 2px 7px;
    background: #f1f5f9;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #1e293b;
    word-break: break-all;
}

/* Row actions group: keeps multiple buttons aligned & spaced */
.bwtr-row-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
}

.bwtr-row-actions .bwtr-inline-form {
    display: inline-flex;
}

.bwtr-icon-btn {
    min-width: 48px;
    padding: 3px 10px !important;
    font-size: 12px;
    line-height: 1.4;
}

.bwtr-icon-btn.is-danger {
    color: #b91c1c !important;
    border-color: #fecaca !important;
    background: #fef2f2 !important;
}

.bwtr-icon-btn.is-danger:hover {
    color: #fff !important;
    background: #b91c1c !important;
    border-color: #b91c1c !important;
}

.bwtr-icon-btn.is-warning {
    color: #b45309 !important;
    border-color: #fde68a !important;
    background: #fffbeb !important;
}

.bwtr-icon-btn.is-warning:hover {
    color: #fff !important;
    background: #b45309 !important;
    border-color: #b45309 !important;
}

.bwtr-icon-btn.is-disabled,
.bwtr-icon-btn:disabled {
    color: #cbd5e1 !important;
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed;
    opacity: 0.85;
}

/* Inline cell links */
.bwtr-link,
.bwtr-link-strong,
.bwtr-link-mono {
    color: #1d4ed8 !important;
    text-decoration: none;
    transition: color 100ms ease;
}

.bwtr-link:hover,
.bwtr-link-strong:hover,
.bwtr-link-mono:hover {
    color: #0f3a8a !important;
    text-decoration: underline;
}

.bwtr-link-strong {
    font-weight: 700;
    color: #0f172a !important;
}

.bwtr-link-strong:hover {
    color: #1d4ed8 !important;
}

.bwtr-link-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
}

.bwtr-error-line {
    color: #b91c1c;
    font-size: 11px;
    margin-top: 3px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

/* Requests table: 8 cohesive columns. Force layout via colgroup-style widths. */
.bwtr-requests-table {
    table-layout: fixed;
    width: 100%;
}

.bwtr-requests-table th,
.bwtr-requests-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Column proportions on full-width admin (sums to 100%):
   Request 12% / Client 16% / Target 16% / Type 8% / Amount 8% / Status 14% / Ref 14% / Actions 12% */
.bwtr-requests-table .bwtr-rq-col-req      { width: 12%; }
.bwtr-requests-table .bwtr-rq-col-client   { width: 16%; }
.bwtr-requests-table .bwtr-rq-col-target   { width: 16%; }
.bwtr-requests-table .bwtr-rq-col-type     { width:  8%; white-space: nowrap; }
.bwtr-requests-table .bwtr-rq-col-amount   { width:  8%; white-space: nowrap; text-align: right; font-feature-settings: "tnum"; }
.bwtr-requests-table .bwtr-rq-col-status   { width: 14%; }
.bwtr-requests-table .bwtr-rq-col-ref      { width: 14%; }
.bwtr-requests-table .bwtr-rq-col-act      { width: 12%; text-align: right; }

/* Request cell internals */
.bwtr-rq-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.bwtr-rq-time {
    color: #64748b;
    font-size: 11px;
    font-feature-settings: "tnum";
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .bwtr-requests-table {
        table-layout: auto;
    }
    .bwtr-requests-table th,
    .bwtr-requests-table td {
        white-space: normal;
        word-break: break-word;
    }
    .bwtr-rq-col-amount,
    .bwtr-rq-col-type {
        white-space: nowrap;
    }
}

/* Campaigns table: fixed layout
   Name 18% / Status 7% / Period 18% / Products 18% / Purchase 14% / Zero 7% / Actions 18% */
.bwtr-campaigns-table {
    table-layout: fixed;
    width: 100%;
}

.bwtr-campaigns-table th,
.bwtr-campaigns-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

.bwtr-campaigns-table .bwtr-cp-col-name      { width: 18%; }
.bwtr-campaigns-table .bwtr-cp-col-status    { width:  7%; white-space: nowrap; }
.bwtr-campaigns-table .bwtr-cp-col-period    { width: 18%; }
.bwtr-campaigns-table .bwtr-cp-col-products  { width: 18%; }
.bwtr-campaigns-table .bwtr-cp-col-purchase  { width: 14%; }
.bwtr-campaigns-table .bwtr-cp-col-zero      { width:  7%; white-space: nowrap; }
.bwtr-campaigns-table .bwtr-cp-col-act       { width: 18%; text-align: right; }

/* Blocks table: fixed layout
   Name 25% / Type 18% / Value 30% / Status 12% / Actions 15% */
.bwtr-blocks-table {
    table-layout: fixed;
    width: 100%;
}

.bwtr-blocks-table th,
.bwtr-blocks-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

.bwtr-blocks-table .bwtr-bk-col-name    { width: 25%; }
.bwtr-blocks-table .bwtr-bk-col-type    { width: 18%; white-space: nowrap; }
.bwtr-blocks-table .bwtr-bk-col-value   { width: 30%; }
.bwtr-blocks-table .bwtr-bk-col-status  { width: 12%; white-space: nowrap; }
.bwtr-blocks-table .bwtr-bk-col-act     { width: 15%; text-align: right; }

/* Force the row-actions group to stay horizontal even in narrow cells */
.bwtr-row-actions {
    flex-wrap: nowrap;
}

@media (max-width: 1100px) {
    .bwtr-campaigns-table,
    .bwtr-blocks-table {
        table-layout: auto;
    }
    .bwtr-campaigns-table th,
    .bwtr-campaigns-table td,
    .bwtr-blocks-table th,
    .bwtr-blocks-table td {
        white-space: normal;
        word-break: break-word;
    }
    .bwtr-row-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

/* Requests filter: single grid with submit button as last cell */
.bwtr-requests-filter {
    margin-bottom: 14px;
}

.bwtr-requests-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    align-items: end;
}

.bwtr-requests-filter-grid .bwtr-filter-q {
    grid-column: span 2;
}

.bwtr-requests-filter-grid .bwtr-filter-submit {
    align-self: end;
}

.bwtr-requests-filter-grid .bwtr-filter-submit > span {
    visibility: hidden;
    height: 12px;
}

.bwtr-requests-filter-grid .bwtr-filter-submit button {
    width: 100%;
    min-height: 34px;
}

@media (max-width: 720px) {
    .bwtr-requests-filter-grid .bwtr-filter-q {
        grid-column: span 1;
    }
}

/* Picker trigger height alignment with input/select inside admin */
.bwtr-admin .bwui-pickr-trigger {
    min-height: 34px;
    padding: 6px 10px;
}

/* Pagination bar: page info + per-page on left, page links on right */
.bwtr-admin .bwtr-pagination-bar {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
    margin-top: 14px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.bwtr-admin .bwtr-pagination-left {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
}

.bwtr-admin .bwtr-pagination-info {
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    font-feature-settings: "tnum";
}

.bwtr-admin .bwtr-pagination-pages {
    display: inline-flex !important;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 !important;
    padding: 0 !important;
}

.bwtr-admin .bwtr-pagination-pages a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #475569 !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.bwtr-admin .bwtr-pagination-pages a:hover {
    border-color: #0f62fe;
    color: #0f62fe !important;
    text-decoration: none !important;
}

.bwtr-admin .bwtr-pagination-pages a.active {
    background: #0f62fe !important;
    border-color: #0f62fe;
    color: #fff !important;
}

.bwtr-admin .bwtr-perpage-form {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
    padding: 0 !important;
}

.bwtr-admin .bwtr-perpage-label {
    margin: 0 !important;
    padding: 0 !important;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.bwtr-admin select.bwtr-perpage-select {
    width: auto !important;
    min-width: 64px !important;
    height: 28px;
    min-height: 28px !important;
    padding: 0 6px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1e293b;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.bwtr-admin select.bwtr-perpage-select:focus {
    outline: 0;
    border-color: #0f62fe;
    box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.12);
}

/* tabs styling fully in bw_ui.css */

.bwtr-admin .bwui-alert {
    border-radius: 8px;
    padding: 11px 13px;
}

.bwtr-admin .bwui-card {
    border-radius: 10px;
}

.bwtr-admin .bwui-table-wrap .bwtr-admin-table {
    margin-top: 0;
}

.bwtr-admin .bwui-table th {
    background: #f8fafc !important;
    color: #334155 !important;
    white-space: nowrap;
}

.bwtr-admin .bwui-table th,
.bwtr-admin .bwui-table td {
    border-color: #e2e8f0 !important;
    vertical-align: middle;
}

.bwtr-admin .bwui-field > input,
.bwtr-admin .bwui-field > select,
.bwtr-admin .bwui-input {
    min-height: 34px;
}

.bwtr-admin .bwui-table-wrap {
    margin-top: 2px;
}

.bwtr-log-open {
    margin-top: 8px;
}

.bwtr-log-open:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.bwtr-log-template {
    display: none;
}

.bwtr-log-modal {
    max-width: 760px;
}

.bwtr-log-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
}

.bwtr-log-modal-x {
    appearance: none;
    border: 0;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 22px;
    line-height: 1;
    width: 34px;
    height: 34px;
    cursor: pointer;
}

.bwtr-log-modal-x:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.bwtr-log-modal-body {
    max-height: 62vh;
    overflow: auto;
}

.bwtr-log-list {
    margin: 0;
    padding-left: 18px;
}

.bwtr-log-list li {
    margin: 0 0 8px;
    color: #334155;
}

.bwtr-log-list li span {
    color: #64748b;
    display: block;
    font-size: 11px;
}

.bwtr-log-list code {
    display: block;
    margin-top: 3px;
    white-space: normal;
    word-break: break-word;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 4px 6px;
}

.bwtr-log-level-error strong {
    color: #991b1b;
}

.bwtr-log-level-warning strong {
    color: #92400e;
}

.bwtr-log-level-info strong {
    color: #075985;
}

@media (max-width: 640px) {
    .bwtr-admin-table {
        display: block;
        overflow-x: auto;
    }
}
