/* Responsive finishing layer for the internal loyalty workspace. */
.slfd-history-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
    gap: 12px;
    align-items: end;
    padding: 0 24px 22px;
}

.slfd-history-filters label {
    display: grid;
    gap: 6px;
    color: var(--slfd-muted);
    font-size: 12px;
    font-weight: 700;
}

.slfd-history-filters input,
.slfd-history-filters select,
.slfd-history-filters button,
.slfd-pending input[type="url"] {
    min-height: 44px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    color: var(--slfd-ink);
    font: inherit;
}

.slfd-history-filters input,
.slfd-history-filters select,
.slfd-pending input[type="url"] {
    width: 100%;
    padding: 0 11px;
}

.slfd-history-filters button {
    padding: 0 16px;
    border-color: var(--slfd-navy);
    background: var(--slfd-navy);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.slfd-history-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 0 24px 22px;
}

.slfd-history-kpis > div {
    min-height: 102px;
    padding: 16px;
    border: 1px solid var(--slfd-line);
    border-radius: 8px;
    background: #f8fafb;
}

.slfd-history-kpis span,
.slfd-history-kpis strong {
    display: block;
}

.slfd-history-kpis span {
    color: var(--slfd-muted);
    font-size: 12px;
    font-weight: 700;
}

.slfd-history-kpis strong {
    margin-top: 7px;
    color: var(--slfd-pink-dark);
    font-size: 27px;
    line-height: 1;
}

.slfd-history .slfd-table-scroll {
    margin: 0 -23px;
    border-top: 1px solid var(--slfd-line);
    border-bottom: 1px solid var(--slfd-line);
}

.slfd-history table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.slfd-history th,
.slfd-history td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--slfd-line);
    text-align: left;
    white-space: nowrap;
}

.slfd-history th {
    color: #475467;
    background: #f8fafb;
    font-size: 12px;
}

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

.slfd-history td a {
    color: var(--slfd-pink-dark);
    font-weight: 800;
}

.slfd-history .slfd-footnote {
    margin: 0 -23px -23px;
    padding: 15px 23px;
}

.slfd-pending > p {
    line-height: 1.55;
}

.slfd-pill--good {
    background: #e9f8ef;
    color: var(--slfd-good);
}

@media (max-width: 760px) {
    .slfd-page {
        overflow-x: hidden;
    }

    .slfd-topbar {
        min-height: 0;
        padding: 14px 18px 16px;
        gap: 12px;
    }

    .slfd-brand {
        font-size: 20px;
    }

    .slfd-brand .dashicons {
        width: 34px;
        height: 34px;
        font-size: 34px;
    }

    .slfd-internal,
    .slfd-report-module {
        display: none;
    }

    .slfd-topbar time,
    .slfd-top-link {
        width: 100%;
        margin-left: 0;
        font-size: 13px;
    }

    .slfd-content,
    .slfd-report-page {
        width: calc(100% - 28px);
        padding: 28px 0 42px;
    }

    .slfd-heading {
        gap: 18px;
        margin-bottom: 22px;
    }

    .slfd-heading h1,
    .slfd-report-heading h1,
    .slfd-login-card h1 {
        font-size: 31px;
        letter-spacing: 0;
    }

    .slfd-heading > div > p:last-child {
        font-size: 15px;
    }

    .slfd-heading-actions,
    .slfd-heading-actions .slfd-primary,
    .slfd-heading-actions .slfd-secondary {
        width: 100%;
    }

    .slfd-primary,
    .slfd-secondary {
        min-height: 48px;
        justify-content: center;
        border-radius: 8px;
    }

    .slfd-table-card,
    .slfd-alert-card,
    .slfd-pending,
    .slfd-report-form,
    .slfd-login-card {
        border-radius: 8px;
    }

    .slfd-table-head {
        padding: 18px;
    }

    .slfd-table-head form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
    }

    .slfd-table-head form label {
        display: grid;
        gap: 6px;
    }

    .slfd-table-head form input,
    .slfd-table-head form button {
        min-height: 44px;
    }

    .slfd-alert-card,
    .slfd-pending {
        padding: 18px;
    }

    .slfd-alert-row {
        gap: 10px;
        padding: 13px 0;
    }

    .slfd-history-filters {
        grid-template-columns: 1fr 1fr;
        padding: 0 18px 18px;
    }

    .slfd-history-filters label:nth-of-type(3),
    .slfd-history-filters label:nth-of-type(4),
    .slfd-history-filters label:nth-of-type(5),
    .slfd-history-filters button {
        grid-column: 1 / -1;
    }

    .slfd-history-kpis {
        grid-template-columns: 1fr 1fr;
        padding: 0 18px 18px;
    }

    .slfd-history-kpis > div {
        min-height: 92px;
        padding: 14px;
    }

    .slfd-history-kpis strong {
        font-size: 24px;
    }

    .slfd-history .slfd-table-scroll {
        margin: 0 -18px;
        -webkit-overflow-scrolling: touch;
    }

    .slfd-history .slfd-footnote {
        margin: 0 -18px -18px;
        padding: 14px 18px;
    }

    .slfd-pending input[type="url"] {
        margin: 3px 0 12px;
    }

    .slfd-login-wrap {
        min-height: 100svh;
        padding: 16px;
    }

    .slfd-login-card {
        padding: 28px 22px;
    }

    .slfd-login-card .button,
    .slfd-report-form--v2 input,
    .slfd-report-form--v2 select,
    .slfd-report-form--v2 textarea {
        font-size: 16px;
    }
}
@media (max-width: 390px) {
    .slfd-history-filters,
    .slfd-history-kpis {
        grid-template-columns: 1fr;
    }

    .slfd-history-filters label,
    .slfd-history-filters label:nth-of-type(3),
    .slfd-history-filters label:nth-of-type(4),
    .slfd-history-filters label:nth-of-type(5),
    .slfd-history-filters button {
        grid-column: auto;
    }
}
/* Agent accounts */
.slfd-agent-actions {
    align-items: center;
    display: flex;
    gap: 8px;
}

.slfd-agent-actions form { margin: 0; }

.slfd-agents-list .slfd-agent-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
}

.slfd-agent-password {
    grid-column: 1 / -1;
    border-top: 1px solid #e5e7eb;
    padding-top: 14px;
}

.slfd-agent-password summary {
    align-items: center;
    color: #172033;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    gap: 7px;
}

.slfd-agent-password summary .dashicons { color: var(--slfd-pink); }

.slfd-agent-password form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: end;
    margin-top: 14px;
}

.slfd-agent-password label {
    color: #344054;
    display: grid;
    font-size: 12px;
    font-weight: 700;
    gap: 6px;
}

.slfd-agent-password input {
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    min-height: 42px;
    padding: 9px 10px;
}

.slfd-agent-password button {
    background: #112442 !important;
    min-height: 42px;
    white-space: nowrap;
}

.slfd-agents-list article em {
    color: #6b7280;
    display: block;
    font-size: 12px;
    font-style: normal;
    margin-top: 4px;
}

.slfd-delete-agent {
    align-items: center;
    background: #fff !important;
    border: 1px solid #f3c8c5 !important;
    border-radius: 8px !important;
    color: #b42318 !important;
    display: flex;
    height: 38px;
    justify-content: center;
    min-height: 38px;
    padding: 0 !important;
    width: 38px;
}

.slfd-delete-agent:hover,
.slfd-delete-agent:focus { background: #fff1f0 !important; }

.slfd-agents-list .slfd-agent-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.slfd-agent-select,
.slfd-bulk-toggle {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.slfd-agent-select {
    align-self: center;
}

.slfd-agent-select input,
.slfd-bulk-toggle input {
    accent-color: var(--slfd-pink);
    height: 18px;
    margin: 0;
    width: 18px;
}

.slfd-bulk-toggle {
    color: #344054;
    font-size: 13px;
    font-weight: 700;
    margin: 4px 0 16px;
}

.slfd-delete-selection,
.slfd-delete-report {
    align-items: center;
    background: #fff !important;
    border: 1px solid #f3c8c5 !important;
    border-radius: 8px !important;
    color: #b42318 !important;
    display: inline-flex;
    font-weight: 800;
    gap: 7px;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px !important;
}

.slfd-delete-selection:disabled {
    border-color: #e4e7ec !important;
    color: #98a2b3 !important;
    cursor: not-allowed;
}

.slfd-report-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.slfd-report-actions form { margin: 0; }

.slfd-history-actions {
    align-items: center;
    display: flex;
    gap: 10px;
}

.slfd-history-actions form { margin: 0; }

.slfd-history-delete {
    background: transparent !important;
    border: 0 !important;
    color: #b42318 !important;
    font-size: 12px;
    font-weight: 800;
    min-height: auto;
    padding: 0 !important;
}

.slfd-delete-report {
    padding: 0 !important;
    width: 42px;
}

@media (max-width: 760px) {
    .slfd-agents-list article { align-items: flex-start; }

    .slfd-agents-list .slfd-agent-card {
        grid-template-columns: 1fr;
    }

    .slfd-agent-select { align-self: auto; }

    .slfd-agent-actions {
        justify-content: space-between;
        width: 100%;
    }

    .slfd-agent-password form { grid-template-columns: 1fr; }

    .slfd-report-actions,
    .slfd-report-actions .slfd-secondary { width: 100%; }

    .slfd-report-actions .slfd-secondary { justify-content: center; }

    .slfd-delete-report { width: 100%; }
}
