.bot-followups-page,
.bot-followup-settings-page {
    --followup-navy: #173f5f;
    --followup-blue: #2876ad;
    --followup-green: #20815d;
    --followup-muted: #687d8e;
    max-width: 1600px;
    margin: 0 auto;
    padding: 26px;
    color: #263c4d;
    font-size: 14px;
}

.followups-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    padding: 28px 32px;
    color: #fff;
    background: linear-gradient(135deg, #153d5b, #277a92 58%, #22936e);
    border-radius: 18px;
    box-shadow: 0 13px 34px rgba(23, 63, 95, .16);
}

.followups-hero > div:first-child > span {
    color: #c4efff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
}

.followups-hero h2 {
    margin: 5px 0 8px;
    font-size: 29px;
    font-weight: 800;
}

.followups-hero p {
    margin: 0;
    color: rgba(255, 255, 255, .83);
    font-size: 15px;
}

.followups-hero-actions {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.followups-hero-count {
    min-width: 145px;
    padding: 13px 18px;
    text-align: center;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .23);
    border-radius: 12px;
}

.followups-hero-count strong,
.followups-hero-count small {
    display: block;
}

.followups-hero-count strong {
    font-size: 29px;
    line-height: 1;
}

.followups-hero-count small {
    margin-top: 7px;
    color: rgba(255, 255, 255, .86);
    font-size: 12px;
}

.followups-settings-link,
.followups-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 58px;
    padding: 0 18px;
    color: #173f5f;
    background: #fff;
    border: 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
}

.followups-settings-link:hover,
.followups-settings-link:focus,
.followups-back-link:hover,
.followups-back-link:focus {
    color: #0e6b52;
    text-decoration: none;
    background: #f1fffa;
}

.bot-followups-page > .alert,
.bot-followup-settings-page > .alert {
    font-size: 14px;
    line-height: 1.7;
}

.followups-filter-card {
    display: grid;
    grid-template-columns: auto minmax(470px, 1fr) minmax(300px, .8fr);
    align-items: end;
    gap: 16px;
    margin-bottom: 18px;
    padding: 17px;
    background: #fff;
    border: 1px solid #dfe8ee;
    border-radius: 14px;
    box-shadow: 0 7px 22px rgba(32, 56, 76, .055);
}

.followups-tabs {
    display: flex;
    align-items: center;
    gap: 7px;
}

.followups-tabs a {
    min-width: 94px;
    padding: 11px 14px;
    color: #4a6579;
    text-align: center;
    background: #f1f5f7;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
}

.followups-tabs a:hover,
.followups-tabs a:focus {
    text-decoration: none;
    border-color: #cfe0eb;
}

.followups-tabs a.is-active {
    color: #fff;
    background: var(--followup-blue);
    border-color: var(--followup-blue);
}

.followups-tabs strong {
    display: inline-block;
    margin-right: 4px;
}

.followups-date-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr)) auto auto;
    align-items: end;
    gap: 8px;
    margin: 0;
}

.followups-date-filter label {
    margin: 0;
}

.followups-date-filter label span {
    display: block;
    margin-bottom: 6px;
    color: #496174;
    font-size: 12px;
    font-weight: 800;
}

.followups-date-filter .form-control,
.followups-date-filter .btn {
    height: 41px;
    font-size: 13px;
}

.followups-date-filter .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.followups-search {
    position: relative;
}

.followups-search i {
    position: absolute;
    z-index: 1;
    top: 14px;
    right: 13px;
    color: #7890a1;
}

.followups-search input {
    height: 43px;
    padding-right: 39px;
    font-size: 14px;
}

.followups-table-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid #dce6ed;
    border-radius: 15px;
    box-shadow: 0 9px 26px rgba(31, 55, 74, .06);
}

.followups-table-scroll {
    overflow-x: auto;
}

.followups-table {
    width: 100%;
    min-width: 1280px;
    margin: 0;
    border-collapse: collapse;
    table-layout: fixed;
}

.followups-table th {
    padding: 15px 13px;
    color: #34546a;
    text-align: right;
    background: #eef4f7;
    border-bottom: 2px solid #d7e2e9;
    font-size: 13px;
    font-weight: 800;
}

.followups-table th:nth-child(1) { width: 105px; }
.followups-table th:nth-child(2) { width: 30%; }
.followups-table th:nth-child(3) { width: 15%; }
.followups-table th:nth-child(4) { width: 14%; }
.followups-table th:nth-child(5) { width: 145px; }
.followups-table th:nth-child(6) { width: 310px; }

.followups-table td {
    padding: 15px 13px;
    vertical-align: top;
    border-bottom: 1px solid #e4ebf0;
    font-size: 14px;
    line-height: 1.65;
}

.followups-table-row:last-child td {
    border-bottom: 0;
}

.followups-table-row:hover td {
    background: #fbfdfe;
}

.followups-table-row.is-completed td {
    background: #fcfefd;
}

.followup-status {
    display: inline-block;
    padding: 7px 10px;
    white-space: nowrap;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.followup-status.is-pending {
    color: #865800;
    background: #fff0c9;
}

.followup-status.is-done {
    color: #16694d;
    background: #def4e9;
}

.followup-status.is-sending {
    color: #205e8d;
    background: #e1f0fa;
}

.followup-title-line {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--followup-navy);
}

.followup-title-line strong {
    font-size: 16px;
    overflow-wrap: anywhere;
}

.followup-marker {
    display: inline-grid;
    flex: 0 0 35px;
    width: 35px;
    min-height: 35px;
    padding: 4px;
    place-items: center;
    background: #fff2d6;
    border-radius: 9px;
    font-size: 17px;
}

.followup-summary-cell p {
    margin: 9px 0 4px;
    color: #3b5263;
    font-size: 14px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.followup-summary-cell > small {
    color: var(--followup-muted);
    font-size: 12px;
}

.followup-sent-reply {
    margin-top: 9px;
    padding: 8px 10px;
    color: #247057;
    background: #edf8f3;
    border-radius: 8px;
    font-size: 12px;
}

.followup-account-name {
    color: #2e4e63;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.followup-employees-cell span {
    display: block;
    margin-bottom: 9px;
    color: #314e62;
    font-weight: 700;
}

.followup-employees-cell small,
.followup-date-cell small {
    display: block;
    margin-bottom: 2px;
    color: var(--followup-muted);
    font-size: 11px;
    font-weight: 400;
}

.followup-date-cell strong {
    color: #36566c;
    direction: ltr;
    display: inline-block;
    font-size: 13px;
}

.followup-date-cell small {
    margin-top: 7px;
}

.followup-actions-cell > .btn,
.followup-actions-cell > form {
    margin: 0 0 8px;
}

.followup-actions-cell > .btn {
    width: 100%;
    min-height: 39px;
    font-size: 13px;
    font-weight: 800;
}

.followup-reassign-form {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) 82px;
    gap: 6px;
}

.followup-reassign-form .form-control,
.followup-reassign-form .btn,
.followup-delete-form .btn {
    height: 38px;
    font-size: 12px;
}

.followup-delete-form .btn {
    width: 100%;
    font-weight: 700;
}

.followup-done-note,
.followup-busy-note {
    display: block;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.followup-done-note {
    color: #256d55;
    background: #e9f7f1;
}

.followup-busy-note {
    color: #245f89;
    background: #e7f2f9;
}

.followups-empty {
    padding: 42px 20px;
    color: var(--followup-muted);
    text-align: center;
    font-size: 15px;
}

#followups-search-empty {
    display: none;
}

.followup-execute-modal[hidden] {
    display: none;
}

.followup-execute-modal {
    position: fixed;
    z-index: 10050;
    inset: 0;
    display: grid;
    padding: 22px;
    place-items: center;
}

.followup-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 32, 46, .68);
    backdrop-filter: blur(2px);
}

.followup-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(650px, 100%);
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 70px rgba(9, 27, 40, .3);
}

.followup-modal-dialog > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 16px;
}

.followup-modal-dialog > header small {
    color: #288064;
    font-size: 12px;
    font-weight: 800;
}

.followup-modal-dialog > header h3 {
    margin: 4px 0 0;
    color: var(--followup-navy);
    font-size: 22px;
    font-weight: 800;
}

.followup-modal-close {
    width: 39px;
    height: 39px;
    color: #637989;
    background: #edf2f5;
    border: 0;
    border-radius: 9px;
    font-size: 17px;
}

.followup-modal-message {
    margin-bottom: 17px;
    padding: 13px 15px;
    background: #f4f8fa;
    border-right: 4px solid #6ca1bf;
    border-radius: 9px;
}

.followup-modal-message small {
    color: #667e8f;
    font-size: 11px;
    font-weight: 800;
}

.followup-modal-message p {
    margin: 5px 0 0;
    color: #354d5e;
    font-size: 14px;
    line-height: 1.75;
    white-space: pre-wrap;
}

#followup-execute-form > label {
    display: block;
    margin-bottom: 7px;
    color: #294c62;
    font-size: 14px;
    font-weight: 800;
}

#followup-execute-form > label span {
    color: #718697;
    font-size: 11px;
    font-weight: 600;
}

#followup-execute-reply {
    min-height: 125px;
    padding: 12px;
    resize: vertical;
    font-size: 15px;
    line-height: 1.7;
}

.followup-execute-hint,
.followup-api-warning {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.7;
}

.followup-execute-hint {
    color: #336751;
    background: #edf8f3;
}

.followup-api-warning {
    color: #865800;
    background: #fff3d4;
}

.followup-modal-actions {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 19px;
}

.followup-modal-actions .btn {
    min-width: 130px;
    min-height: 42px;
    font-size: 14px;
    font-weight: 800;
}

body.followup-modal-open {
    overflow: hidden;
}

/* Settings page */
.followups-settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr);
    gap: 18px;
    align-items: start;
}

.followups-settings-card,
.followups-help-card {
    padding: 23px;
    background: #fff;
    border: 1px solid #dfe8ee;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(31, 56, 75, .055);
}

.followups-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.followups-card-heading > i {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    color: #815600;
    background: #fff0cc;
    border-radius: 10px;
    place-items: center;
    font-size: 18px;
}

.followups-card-heading h3,
.followups-help-card h3 {
    margin: 0;
    color: var(--followup-navy);
    font-size: 20px;
    font-weight: 800;
}

.followups-card-heading p {
    margin: 5px 0 0;
    color: var(--followup-muted);
    font-size: 13px;
}

.followup-setting-section {
    margin-bottom: 20px;
}

.followup-setting-section + .followup-setting-section {
    padding-top: 20px;
    border-top: 1px solid #e2eaf0;
}

.followup-setting-section > label:not(.followup-switch-row) {
    display: block;
    margin-bottom: 8px;
    color: #2d4b60;
    font-size: 14px;
    font-weight: 800;
}

.followups-settings-card textarea {
    margin-bottom: 9px;
    resize: vertical;
    line-height: 1.75;
}

.followups-settings-card .followup-trigger-terms {
    min-height: 150px;
    font-size: 18px;
}

.followups-settings-card .followup-confirmation-message {
    min-height: 100px;
    font-size: 15px;
    transition: opacity .2s, background .2s;
}

.followups-settings-card .followup-confirmation-message.is-disabled {
    opacity: .62;
    background: #f0f4f6;
}

.followup-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 17px;
    cursor: pointer;
}

.followup-switch-row strong,
.followup-switch-row small {
    display: block;
}

.followup-switch-row strong {
    color: #294a60;
    font-size: 15px;
}

.followup-switch-row small,
.followup-setting-hint {
    color: var(--followup-muted);
    font-size: 12px;
    line-height: 1.7;
}

.followup-switch-row input {
    position: relative;
    flex: 0 0 48px;
    width: 48px;
    height: 27px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: #b8c4cc;
    border: 0;
    border-radius: 20px;
    outline: 0;
    transition: background .2s;
}

.followup-switch-row input::after {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 19px;
    height: 19px;
    content: '';
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(20, 42, 57, .27);
    transition: transform .2s;
}

.followup-switch-row input:checked {
    background: #22aa75;
}

.followup-switch-row input:checked::after {
    transform: translateX(-21px);
}

.followup-switch-row input:focus {
    box-shadow: 0 0 0 3px rgba(34, 170, 117, .18);
}

.followups-settings-card .btn-block {
    min-height: 44px;
    font-size: 14px;
    font-weight: 800;
}

.followups-help-card {
    color: #3b5c72;
    background: #f1f8fc;
    border-color: #d5e8f2;
}

.followups-help-card ol {
    margin: 16px 0 0;
    padding-right: 21px;
    font-size: 14px;
    line-height: 2;
}

.followups-help-card code {
    color: #205e88;
    background: #fff;
    font-size: 13px;
}

@media (max-width: 1280px) {
    .followups-filter-card {
        grid-template-columns: 1fr 1fr;
    }
    .followups-tabs {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .followups-filter-card,
    .followups-settings-layout {
        grid-template-columns: 1fr;
    }
    .followups-date-filter,
    .followups-search {
        grid-column: auto;
    }
}

@media (max-width: 680px) {
    .bot-followups-page,
    .bot-followup-settings-page {
        padding: 12px;
    }
    .followups-hero,
    .followups-hero-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .followups-hero {
        padding: 22px;
    }
    .followups-hero h2 {
        font-size: 24px;
    }
    .followups-date-filter {
        grid-template-columns: 1fr;
    }
    .followups-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
    .followups-tabs a {
        min-width: 0;
        padding: 10px 6px;
    }
    .followup-execute-modal {
        padding: 10px;
    }
    .followup-modal-dialog {
        padding: 18px;
    }
    .followup-modal-actions,
    .followup-modal-actions .btn {
        width: 100%;
    }
    .followup-modal-actions {
        flex-direction: column-reverse;
    }
}
