/* BP - Estilos adicionales para Business Partner */

.bp-role-chip {
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .3px;
    border: 1px solid;
    display: inline-flex;
    align-items: center;
}

.bp-role-chip.customer { background: var(--g-info-bg); color: var(--g-info); border-color: var(--g-info); }
.bp-role-chip.vendor { background: var(--g-warn-bg); color: var(--g-warn); border-color: var(--g-warn); }
.bp-role-chip.carrier { background: var(--g-info-bg); color: var(--g-info); border-color: var(--g-info-border); }
.bp-role-chip.agent { background: var(--g-ok-bg); color: var(--g-ok); border-color: var(--g-ok); }
.bp-role-chip.inactive { opacity: .45; text-decoration: line-through; }

.bp-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 900px) {
    .bp-split {
        grid-template-columns: 1fr;
    }
}

.bp-split-section {
    background: var(--g-surface);
    border: 1px solid var(--g-border);
    border-radius: 9px;
    overflow: hidden;
}

.bp-split-head {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--g-text-sec);
    text-transform: uppercase;
    letter-spacing: .4px;
    background: var(--g-surface-sec);
    border-bottom: 1px solid var(--g-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.bp-split-body {
    padding: 12px 16px;
}

.bp-add-btn {
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid var(--g-create);
    background: var(--g-surface);
    color: var(--g-create);
    transition: all .12s;
}

.bp-add-btn:hover {
    background: var(--g-selected-bg);
}

.bp-ctx-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--g-border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.bp-ctx-toggle-btn {
    padding: 7px 16px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: var(--g-surface);
    color: var(--g-text-muted);
    transition: all .15s;
}

.bp-ctx-toggle-btn.active {
    background: var(--g-create);
    color: var(--accent-contrast);
}

.bp-ctx-toggle-btn:hover:not(.active) {
    background: var(--g-surface-sub);
}

.bp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--overlay-scrim);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
}

.bp-modal {
    width: min(760px, 100%);
    background: var(--g-surface);
    border: 1px solid var(--g-border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.bp-modal-title {
    padding: 14px 18px;
    border-bottom: 1px solid var(--g-border);
    background: var(--g-surface-sec);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .45px;
    text-transform: uppercase;
    color: var(--g-text-sec);
}

.bp-modal-body {
    padding: 16px 18px;
}

.bp-modal-actions {
    padding: 14px 18px;
    border-top: 1px solid var(--g-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.bp-inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bp-context-pill {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--g-text-sec);
}

.bp-table-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.bp-mini-btn {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--g-border);
    background: var(--g-surface);
    color: var(--g-text-sec);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.bp-mini-btn:hover {
    border-color: var(--g-create);
    color: var(--g-create);
}

.bp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 900px) {
    .bp-grid-2 {
        grid-template-columns: 1fr;
    }
}

.bp-transaction-page .gtrx-shell {
    padding: 14px;
}

.bp-transaction-page .gtrx-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.bp-state-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.bp-state-strip div {
    min-width: 0;
    border: 1px solid var(--mm-border);
    background: var(--mm-surface-card);
    padding: 7px 9px;
}

.bp-state-strip span {
    display: block;
    color: var(--mm-text-muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.bp-state-strip strong {
    display: block;
    overflow: hidden;
    color: var(--mm-text);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bp-rules {
    border: 1px solid var(--mm-border);
    background: var(--mm-surface-card);
    padding: 10px;
    margin-bottom: 10px;
}

.bp-rules h3 {
    margin: 0 0 8px;
    color: var(--mm-text);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 800;
}

.bp-rules p {
    margin: 0 0 7px;
    color: var(--mm-text-muted);
    font-size: 11px;
}

.bp-rule {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    border-bottom: 1px solid color-mix(in srgb, var(--mm-border) 60%, transparent);
    color: var(--mm-text-muted);
    font-size: 11px;
    font-weight: 700;
}

.bp-rule:last-child {
    border-bottom: 0;
}

.bp-rule::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--g-warn);
}

.bp-rule.ok {
    color: var(--g-ok);
}

.bp-rule.ok::before {
    background: var(--g-ok);
}

.bp-access-panel .rl-access {
    min-height: 260px;
    padding: 18px 0;
}

.bp-access-panel .rl-access-card {
    box-shadow: none;
}

.bp-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    column-gap: 20px;
}

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

.bp-role-add {
    align-items: center;
    margin-top: 10px;
}

.bp-role-add .bp-inline-actions {
    align-items: center;
    min-height: 28px;
}

.bp-empty {
    border: 1px dashed var(--mm-border);
    background: var(--mm-surface-card);
}

@media (max-width: 1100px) {
    .bp-filter-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 900px) {
    .bp-state-strip,
    .bp-filter-grid {
        grid-template-columns: 1fr;
    }
}
