/* =========================================================
   TWP WORKFORCE — INTERACTIONS
   Interaction-specific styling only.
   Sidebar/mobile navigation is controlled by:
   employee-dashboard.css + mobile-navigation.css
   ========================================================= */

.twp-wf-interactions-page {
    min-height: 100vh;
    background: #f5f8fb;
    color: #172a42;
    font-family: inherit;
}

.twp-wf-interactions-main {
    margin-left: 0;
    min-width: 0;
}

.twp-wf-interactions-content {
    padding: 24px 28px 36px;
    max-width: 1600px;
    margin: 0 auto;
}

/* =========================================================
   KPI AREA
   ========================================================= */

.twp-wf-interaction-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) 190px;
    gap: 14px;
    margin-bottom: 18px;
}

.twp-wf-interaction-kpi {
    min-height: 108px;
    background: #fff;
    border: 1px solid #e5ebf2;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px;
    box-shadow: 0 5px 18px rgba(31, 57, 86, .045);
}

.twp-wf-interaction-kpi .kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
}

.twp-wf-interaction-kpi .kpi-icon svg {
    width: 24px;
    height: 24px;
}

.twp-wf-interaction-kpi .blue {
    background: #e8f1ff;
    color: #1670df;
}

.twp-wf-interaction-kpi .green {
    background: #e2f7ed;
    color: #159465;
}

.twp-wf-interaction-kpi .orange {
    background: #fff0da;
    color: #ed8b08;
    font-size:26px;
}

.twp-wf-interaction-kpi .purple {
    background: #eee7ff;
    color: #7544dc;
    font-size:26px;
}

.twp-wf-interaction-kpi small {
    display: block;
    color: #2d4159;
    font-size:14px;
}

.twp-wf-interaction-kpi strong {
    display: block;
    font-size:28px;
    line-height: 1.1;
    color: #1769e0;
    margin: 4px 0;
}

.twp-wf-interaction-kpi:nth-child(2) strong {
    color: #13945f;
}

.twp-wf-interaction-kpi:nth-child(3) strong {
    color: #ed8700;
}

.twp-wf-interaction-kpi:nth-child(4) strong {
    color: #7141d6;
}

.twp-wf-interaction-kpi div span {
    display: block;
    color: #8290a1;
    font-size:12px;
}

.twp-wf-interaction-kpis .twp-wf-primary-action {
    height: 48px;
    align-self: center;
    white-space: nowrap;
}

.twp-wf-primary-action {
    border: 0;
    background: #1769e0;
    color: #fff;
    border-radius: 7px;
    padding: 0 16px;
    font-size:13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    box-shadow: 0 5px 12px rgba(23, 105, 224, .12);
}

.twp-wf-primary-action svg {
    width: 17px;
    height: 17px;
}

.twp-wf-primary-action .action-caret {
    display:inline-block;
    width:7px;
    height:7px;
    border-right:2px solid currentColor;
    border-bottom:2px solid currentColor;
    transform:rotate(45deg);
    margin-left:6px;
    margin-top:-3px;
    font-size:0;
    line-height:0;
    flex:0 0 7px;
}

/* =========================================================
   FILTERS
   ========================================================= */

.twp-wf-interaction-filters {
    background: #fff;
    border: 1px solid #e5ebf2;
    border-radius: 9px;
    box-shadow: 0 5px 18px rgba(31, 57, 86, .04);
    padding: 12px;
    margin-bottom: 12px;
}

.twp-wf-interaction-search {
    height: 43px;
    border: 1px solid #dfe7ef;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
}

.twp-wf-interaction-search span {
    color: #6e8198;
    display: flex;
}

.twp-wf-interaction-search svg {
    width: 20px;
    height: 20px;
}

.twp-wf-interaction-search input {
    border: 0;
    outline: 0;
    width: 100%;
    height: 100%;
    font-size:14px;
    color: #2c4058;
    background: transparent;
}

.twp-wf-interaction-search input::placeholder {
    color: #9aa8b8;
}

.twp-wf-date-filter {
    margin-left: auto;
    margin-top: -43px;
    width: 235px;
    height: 43px;
    border: 1px solid #dfe7ef;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    color: #61758c;
    font-size:13px;
}

.twp-wf-date-filter span {
    font-size:16px;
}

.twp-wf-date-filter input {
    border: 0;
    outline: 0;
    background: transparent;
    font-size:12px;
    color: #435971;
    width: 93px;
}

.twp-wf-date-filter em {
    font-style: normal;
    color: #9aa8b8;
}

.twp-wf-reset-link {
    float: right;
    margin: 14px 2px 0 16px;
    color: #1769e0;
    text-decoration: none;
    font-size:12px;
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.twp-wf-reset-link svg {
    width: 15px;
    height: 15px;
}

.twp-wf-interaction-filter-grid {
    clear: both;
    padding-top: 13px;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr)) 112px;
    gap: 10px;
}

.twp-wf-interaction-filter-grid label {
    font-size:11px;
    color: #697a8e;
    font-weight:400;
}

.twp-wf-interaction-filter-grid select {
    display: block;
    margin-top: 5px;
    width: 100%;
    height: 39px;
    border: 1px solid #dfe7ef;
    border-radius: 6px;
    background: #fff;
    color: #40546b;
    font-size:12px;
    padding: 0 9px;
    outline: none;
}

.twp-wf-filter-submit {
    height: 39px;
    margin-top: 14px;
    border: 1px solid #1769e0;
    background: #1769e0;
    color: #fff;
    border-radius: 6px;
    font-size:12px;
    font-weight: 700;
    cursor: pointer;
}

/* =========================================================
   TABS
   ========================================================= */

.twp-wf-interaction-tabs {
    display: flex;
    gap: 3px;
    overflow: auto;
    background: #fff;
    border: 1px solid #e5ebf2;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 12px;
}

.twp-wf-interaction-tab {
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    color: #50657d;
    font-size:13px;
    white-space: nowrap;
}

.twp-wf-interaction-tab:hover {
    background: #f5f8fc;
}

.twp-wf-interaction-tab.is-active {
    background: #1769e0;
    color: #fff;
}

/* =========================================================
   TABLE
   ========================================================= */

.twp-wf-interaction-table-wrap {
    background: #fff;
    border: 1px solid #e5ebf2;
    border-radius: 9px;
    overflow: auto;
    box-shadow: 0 5px 18px rgba(31, 57, 86, .04);
}

.twp-wf-interaction-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
}

.twp-wf-interaction-table th {
    background: #f8fafc;
    border-bottom: 1px solid #e5ebf2;
    color: #607087;
    text-align: left;
    font-size:12px;
    font-weight:600;
    padding: 12px 10px;
    white-space: nowrap;
}

.twp-wf-interaction-table th:first-child,
.twp-wf-interaction-table td:first-child {
    width: 42px;
    text-align: center;
}

.twp-wf-interaction-table td {
    border-bottom: 1px solid #edf1f5;
    padding: 12px 10px;
    font-size:13px;
    color: #263a53;
    vertical-align: middle;
}

.twp-wf-interaction-table tbody tr:hover {
    background: #fbfdff;
}

.twp-wf-interaction-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #1769e0;
}

.twp-wf-client-cell {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 165px;
}

.twp-wf-client-avatar {
    width: 31px;
    height: 31px;
    border-radius: 8px;
    background: #e8f1ff;
    color: #1a6bd7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size:13px;
    font-weight:700;
    flex: 0 0 31px;
}

.twp-wf-client-cell strong,
.twp-wf-client-cell small,
.twp-wf-contact-cell strong,
.twp-wf-contact-cell small,
.twp-wf-interaction-datetime strong,
.twp-wf-interaction-datetime small,
.twp-wf-next-action strong,
.twp-wf-next-action small {
    display: block;
}

.twp-wf-client-cell strong {
    font-size:13px;
    color: #172a42;
}

.twp-wf-client-cell small,
.twp-wf-contact-cell small,
.twp-wf-interaction-datetime small,
.twp-wf-next-action small {
    font-size:11px;
    color: #7a899b;
    margin-top: 3px;
}

.twp-wf-contact-cell strong {
    font-size:13px;
    color: #2b4058;
}

.twp-wf-interaction-type {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    font-size:13px;
}

.twp-wf-interaction-type svg {
    width: 18px;
    height: 18px;
    color: #1769e0;
}

.twp-wf-interaction-datetime strong {
    font-size:13px;
    color: #263b55;
}

.twp-wf-outcome {
    display: inline-block;
    border-radius: 6px;
    padding: 6px 9px;
    font-size:11px;
    font-weight: 700;
    white-space: nowrap;
}

.twp-wf-outcome.green {
    background: #dff5e9;
    color: #168356;
}

.twp-wf-outcome.blue {
    background: #e4efff;
    color: #1769e0;
}

.twp-wf-outcome.purple {
    background: #eee7ff;
    color: #7043d6;
}

.twp-wf-outcome.red {
    background: #ffe5e8;
    color: #df394a;
}

.twp-wf-outcome.orange {
    background: #fff0d9;
    color: #e58300;
}

.twp-wf-outcome.neutral {
    background: #eef2f6;
    color: #65778c;
}

.twp-wf-next-action {
    max-width: 220px;
}

.twp-wf-next-action strong {
    font-size:13px;
    font-weight:600;
    color: #344a62;
    line-height: 1.35;
}

.twp-wf-next-action span {
    font-size:12px;
    color: #8794a3;
}

.twp-wf-created-by {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size:13px;
    white-space: nowrap;
}

.twp-wf-mini-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #dfe4ea;
    display: inline-block;
}

.twp-wf-view-button {
    height: 32px;
    padding: 0 11px;
    border: 1px solid #b9d0e8;
    border-radius: 6px;
    color: #1769e0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-size:12px;
    font-weight:700;
    background: #fff;
}

.twp-wf-more-button {
    width: 29px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #68798c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    cursor: pointer;
}

.twp-wf-more-button svg {
    width: 17px;
    height: 17px;
}

/* =========================================================
   FOOTER / PAGINATION
   ========================================================= */

.twp-wf-interaction-footer {
    min-height: 60px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    color: #718095;
    font-size:10px;
}

.twp-wf-pagination {
    display: flex;
    align-items: center;
    gap: 5px;
}

.twp-wf-pagination a {
    width: 34px;
    height: 34px;
    border: 1px solid #dce5ee;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #4c6179;
    font-size:10px;
}

.twp-wf-pagination a.is-active {
    background: #1769e0;
    border-color: #1769e0;
    color: #fff;
}

/* =========================================================
   EMPTY / ALERTS
   ========================================================= */

.twp-wf-interaction-empty {
    height: 300px !important;
    text-align: center !important;
}

.twp-wf-interaction-empty strong,
.twp-wf-interaction-empty span {
    display: block;
}

.twp-wf-interaction-empty strong {
    font-size:14px;
    color: #334961;
}

.twp-wf-interaction-empty span {
    font-size:13px;
    color: #7c8b9d;
    margin: 7px 0 12px;
}

.twp-wf-empty-add {
    height: 34px;
    padding: 0 14px;
    border: 1px solid #1769e0;
    background: #fff;
    color: #1769e0;
    border-radius: 6px;
    font-size:12px;
    font-weight:600;
    cursor: pointer;
}

.twp-wf-interaction-alert {
    margin-bottom: 12px;
    padding: 11px 14px;
    border-radius: 7px;
    font-size:13px;
}

.twp-wf-interaction-alert.success {
    background: #e3f7ec;
    color: #147c53;
    border: 1px solid #c5ead8;
}

.twp-wf-interaction-alert.error {
    background: #fff0f1;
    color: #c93645;
    border: 1px solid #f5cbd0;
}

/* =========================================================
   MODAL
   ========================================================= */

.twp-wf-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.twp-wf-modal.is-open {
    display: block;
}

.twp-wf-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 28, 48, .48);
}

.twp-wf-interaction-modal {
    position: relative;
    width: min(720px, calc(100% - 28px));
    margin: 7vh auto 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 70px rgba(7, 27, 48, .25);
    overflow: hidden;
}

.twp-wf-modal-header {
    padding: 22px 24px 17px;
    border-bottom: 1px solid #e8edf2;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.twp-wf-modal-header small {
    font-size:11px;
    color: #1769e0;
    font-weight: 750;
    letter-spacing: .12em;
}

.twp-wf-modal-header h2 {
    margin: 4px 0 4px;
    font-size: 22px;
    color: #132b47;
}

.twp-wf-modal-header p {
    margin: 0;
    color: #73849a;
    font-size:13px;
}

.twp-wf-modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid #dce5ee;
    background: #fff;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #60748a;
    cursor: pointer;
}

.twp-wf-interaction-form {
    padding: 20px 24px 22px;
}

.twp-wf-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.twp-wf-form-grid label {
    font-size:12px;
    color: #5e7188;
    font-weight:400;
}

.twp-wf-form-grid label span {
    color: #e53b4b;
}

.twp-wf-form-grid label.full {
    grid-column: 1 / -1;
}

.twp-wf-form-grid input,
.twp-wf-form-grid select,
.twp-wf-form-grid textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    border: 1px solid #dce5ee;
    border-radius: 6px;
    background: #fff;
    color: #2d425a;
    font-size:13px;
    outline: none;
    padding: 10px;
}

.twp-wf-form-grid input,
.twp-wf-form-grid select {
    height: 40px;
}

.twp-wf-form-grid textarea {
    resize: vertical;
    min-height: 100px;
}

.twp-wf-form-grid input:focus,
.twp-wf-form-grid select:focus,
.twp-wf-form-grid textarea:focus {
    border-color: #6ea7e8;
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .08);
}

.twp-wf-form-footer {
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid #edf1f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.twp-wf-form-footer > span {
    font-size:11px;
    color: #8290a0;
}

.twp-wf-form-footer > div {
    display: flex;
    gap: 8px;
}

.twp-wf-secondary-button {
    height: 39px;
    padding: 0 14px;
    border: 1px solid #d5e0eb;
    background: #fff;
    color: #53687f;
    border-radius: 6px;
    font-size:12px;
    font-weight:600;
    cursor: pointer;
}

.twp-wf-save-button {
    height: 39px;
}

/* =========================================================
   RESPONSIVE
   Sidebar positioning is NOT handled here.
   mobile-navigation.css is the single authority.
   ========================================================= */

@media (max-width: 1250px) {

    .twp-wf-interaction-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .twp-wf-interaction-kpis .twp-wf-primary-action {
        grid-column: 4;
        justify-self: end;
        width: 190px;
    }

    .twp-wf-interaction-filter-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .twp-wf-filter-submit {
        grid-column: 4;
    }

    .twp-wf-date-filter {
        width: 235px;
    }
}

@media (max-width: 850px) {

    .twp-wf-interactions-content {
        padding: 18px 14px;
    }

    .twp-wf-interaction-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .twp-wf-interaction-kpis .twp-wf-primary-action {
        grid-column: span 2;
        justify-self: start;
        width: auto;
    }

    .twp-wf-interaction-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .twp-wf-filter-submit {
        grid-column: auto;
    }

    .twp-wf-date-filter {
        float: none;
        margin: 10px 0 0;
        width: 100%;
    }

    .twp-wf-reset-link {
        float: none;
        margin: 12px 0 0;
    }

    .twp-wf-form-grid {
        grid-template-columns: 1fr;
    }

    .twp-wf-form-grid label.full {
        grid-column: auto;
    }

    .twp-wf-form-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .twp-wf-form-footer > div {
        width: 100%;
    }

    .twp-wf-secondary-button,
    .twp-wf-save-button {
        flex: 1;
    }
}

@media (max-width: 560px) {

    .twp-wf-interactions-content {
        padding: 12px;
    }

    .twp-wf-interaction-kpi {
        min-height: 88px;
        padding: 11px;
        gap: 8px;
    }

    .twp-wf-interaction-kpi .kpi-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .twp-wf-interaction-kpi strong {
        font-size:23px;
    }

    .twp-wf-interaction-kpi small {
        font-size:12px;
        font-weight:400;
    }

    .twp-wf-interaction-kpi div span {
        font-size:11px;
    }

    .twp-wf-interaction-filter-grid {
        grid-template-columns: 1fr;
    }

    .twp-wf-filter-submit {
        width: 100%;
        grid-column: auto;
    }

    .twp-wf-interaction-tabs {
        border-radius: 7px;
    }

    .twp-wf-interaction-tab {
        padding: 9px 13px;
        font-size:12px;
    }

    .twp-wf-interaction-table th {
        font-size:12px;
    }

    .twp-wf-interaction-table td {
        font-size:12px;
    }

    .twp-wf-client-cell strong {
        font-size:13px;
    }

    .twp-wf-client-cell small {
        font-size:11px;
    }

    .twp-wf-contact-cell strong {
        font-size:13px;
    }

    .twp-wf-interaction-type {
        font-size:12px;
    }

    .twp-wf-interaction-datetime strong {
        font-size:13px;
    }

    .twp-wf-interaction-datetime small {
        font-size:11px;
    }

    .twp-wf-next-action strong {
        font-size:13px;
    }

    .twp-wf-next-action span {
        font-size:12px;
    }

    .twp-wf-created-by {
        font-size:12px;
    }

    .twp-wf-view-button {
        font-size:12px;
    }

    .twp-wf-interaction-footer {
        align-items: flex-start;
        gap: 10px;
        flex-direction: column;
        padding: 12px 14px;
    }

    .twp-wf-pagination {
        align-self: flex-end;
    }

    .twp-wf-interaction-modal {
        margin-top: 3vh;
    }

    .twp-wf-modal-header {
        padding: 18px;
    }

    .twp-wf-interaction-form {
        padding: 17px 18px;
    }
}