.bfsp-wrap {
    max-width: 1180px;
}

.bfsp-subtitle {
    color: #555;
    font-size: 15px;
    margin: 4px 0 18px;
}

.bfsp-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    margin: 16px 0;
    padding: 18px;
}

.bfsp-form .form-table th {
    width: 190px;
}

.bfsp-toolbar {
    align-items: center;
    display: flex;
    gap: 8px;
    margin: 18px 0;
}

.bfsp-toolbar input[type="search"] {
    min-width: 320px;
}

.bfsp-table td,
.bfsp-table th {
    vertical-align: middle;
}

.bfsp-badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
}

.bfsp-badge.active {
    background: #e8f7ee;
    color: #137333;
}

.bfsp-badge.inactive {
    background: #f6f7f7;
    color: #646970;
}

.bfsp-staff-filter {
    margin-bottom: 18px;
}

.bfsp-filter-grid {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(260px, 1fr) minmax(220px, 300px) auto;
}

.bfsp-filter-grid label span {
    color: #1d2327;
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

.bfsp-filter-grid input,
.bfsp-filter-grid select {
    max-width: 100%;
    min-height: 38px;
    width: 100%;
}

.bfsp-filter-button {
    min-height: 38px;
}

.bfsp-template-list {
    display: grid;
    gap: 14px;
}

.bfsp-template-card {
    margin: 0;
}

.bfsp-template-head {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.bfsp-template-head h2 {
    font-size: 18px;
    line-height: 1.25;
    margin: 0 0 8px;
}

.bfsp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bfsp-meta span {
    background: #f6f7f7;
    border: 1px solid #e5e5e5;
    border-radius: 999px;
    color: #3c434a;
    font-size: 12px;
    padding: 4px 9px;
}

.bfsp-condition {
    background: #fff8e5;
    border-left: 4px solid #dba617;
    border-radius: 8px;
    margin: 14px 0;
    padding: 10px 12px;
}

.bfsp-template-body {
    background: #111827;
    border-radius: 12px;
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.65;
    margin: 14px 0 0;
    overflow: auto;
    padding: 14px;
    white-space: pre-wrap;
}

.bfsp-copy-button.is-copied {
    border-color: #137333 !important;
    color: #137333 !important;
}

.bfsp-empty {
    color: #646970;
    text-align: center;
}

.bfsp-frontend .button,
.bfsp-frontend button {
    cursor: pointer;
}

@media (max-width: 782px) {
    .bfsp-filter-grid {
        grid-template-columns: 1fr;
    }

    .bfsp-template-head {
        flex-direction: column;
    }

    .bfsp-copy-button {
        width: 100%;
    }

    .bfsp-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .bfsp-toolbar input[type="search"],
    .bfsp-toolbar .button {
        min-width: 0;
        width: 100%;
    }
}

/* WhatsApp-ready preview + extra copy blocks */
.bfsp-help-text {
    margin-top: 8px;
}

.bfsp-mini-example {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    color: #3c434a;
    display: inline-block;
    font-size: 12px;
    margin: 8px 0 0;
    padding: 8px 10px;
    white-space: pre-wrap;
}

.bfsp-copy-whatsapp {
    background: #128c7e !important;
    border-color: #128c7e !important;
    color: #fff !important;
    font-weight: 700;
}

.bfsp-copy-whatsapp:hover,
.bfsp-copy-whatsapp:focus {
    background: #075e54 !important;
    border-color: #075e54 !important;
    color: #fff !important;
}

.bfsp-template-body.bfsp-wa-preview,
.bfsp-template-body-has-copy {
    background: #efeae2;
    border: 1px solid #e1d8cf;
    border-radius: 14px;
    color: #111b21;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    margin: 14px 0 0;
    overflow: visible;
    padding: 14px;
    white-space: normal;
}

.bfsp-wa-preview {
    white-space: pre-wrap;
    word-break: break-word;
}

.bfsp-wa-preview strong {
    font-weight: 700;
}

.bfsp-wa-preview em {
    font-style: italic;
}

.bfsp-wa-preview del {
    opacity: .85;
    text-decoration: line-through;
}

.bfsp-wa-preview code {
    background: rgba(0, 0, 0, .07);
    border-radius: 4px;
    font-family: "SF Mono", Consolas, Monaco, monospace;
    font-size: .92em;
    padding: 1px 5px;
}

.bfsp-template-note {
    background: rgba(255, 255, 255, .72);
    border: 1px dashed #d2c8bd;
    border-radius: 10px;
    color: #3b4a54;
    margin-bottom: 12px;
    padding: 10px 12px;
}

.bfsp-extra-copy-block {
    background: #d9fdd3;
    border: 1px solid #bdecb6;
    border-radius: 12px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
    margin: 10px 0;
    padding: 10px 12px;
    position: relative;
}

.bfsp-extra-copy-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 8px;
}

.bfsp-extra-copy-head span {
    color: #075e54;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.bfsp-extra-copy-text {
    color: #111b21;
    padding-right: 4px;
}

/* Clear Copy Ready panel shown to staff */
.bfsp-copy-ready-panel {
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 16px;
    margin: 16px 0 0;
    overflow: hidden;
}

.bfsp-copy-ready-head {
    align-items: center;
    background: #f6f7f7;
    border-bottom: 1px solid #dcdcde;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 14px;
}

.bfsp-copy-ready-head strong {
    color: #1d2327;
    display: block;
    font-size: 14px;
    line-height: 1.25;
}

.bfsp-copy-ready-kicker {
    color: #128c7e;
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    line-height: 1.3;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.bfsp-template-body.bfsp-copy-ready-preview {
    background: #e7ffdb;
    border: 0;
    border-radius: 0;
    box-shadow: inset 4px 0 0 #128c7e;
    margin: 0;
}

.bfsp-extra-copy-title {
    color: #075e54;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

@media (max-width: 782px) {
    .bfsp-copy-ready-head {
        align-items: stretch;
        flex-direction: column;
    }
}
