/* RRV3 Contractor Work Request (CWR) Module styles */
.rrv3-cwr-dashboard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.rrv3-cwr-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.15;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}
.cwr-status-pending-sbu-approval {
    background: #fef3c7;
    color: #92400e;
    border-color: #f59e0b;
}
.cwr-status-issued,
.cwr-status-in-progress {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}
.cwr-status-completed {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}
.cwr-status-rejected,
.cwr-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.rrv3-cwr-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.rrv3-cwr-stat-card {
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    background: #ffffff;
    padding: 14px 16px;
    box-shadow: 0 3px 10px rgba(15,23,42,.05);
}
.rrv3-cwr-stat-card label {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.rrv3-cwr-stat-card strong {
    color: #0f172a;
    font-size: 22px;
}
@media (max-width: 760px) {
    .rrv3-cwr-dashboard-head {
        flex-direction: column;
    }
}

/* CWR create form */
.rrv3-cwr-create-page {
    max-width: 1040px;
    margin: 0 auto;
}
.rrv3-cwr-create-intro {
    border-left: 4px solid #2563eb;
}
.rrv3-cwr-form .rrv3-section h2 {
    margin-top: 0;
}
.rrv3-cwr-selected-so-card {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
    color: #1e3a8a;
}
.rrv3-cwr-selected-so-card strong {
    color: #1e3a8a;
}
.rrv3-cwr-rm-input {
    display: flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.rrv3-cwr-rm-input span {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    background: #f8fafc;
    border-right: 1px solid #cbd5e1;
    font-weight: 900;
    color: #475569;
}
.rrv3-cwr-rm-input input {
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
.rrv3-cwr-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 14px 0 18px;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid #dbe3ef;
}
@media (max-width: 720px) {
    .rrv3-cwr-form-actions .rrv3-button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}
.rrv3-cwr-so-pill {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1e40af;
    font-size: 10px;
    font-weight: 900;
}

/* CWR mobile-friendly SBU approval page */
.rrv3-cwr-review-page {
    max-width: 980px;
    margin: 0 auto;
    padding-bottom: 96px;
}
.rrv3-cwr-review-card {
    border: 1px solid #dbe3ef;
    border-radius: 22px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
}
.rrv3-cwr-review-hero {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border-bottom: 1px solid #dbe3ef;
}
.rrv3-cwr-review-hero h2 {
    margin: 8px 0 6px;
    color: #0f172a;
    font-size: 24px;
}
.rrv3-cwr-review-hero p {
    margin: 0;
    color: #475569;
    font-weight: 650;
}
.rrv3-cwr-review-nte {
    min-width: 150px;
    text-align: right;
}
.rrv3-cwr-review-nte label {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.rrv3-cwr-review-nte strong {
    color: #166534;
    font-size: 20px;
}
.rrv3-cwr-review-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px 20px;
}
.rrv3-cwr-review-section {
    border: 1px solid #e5edf7;
    border-radius: 16px;
    background: #f8fafc;
    padding: 15px;
}
.rrv3-cwr-review-wide {
    grid-column: 1 / -1;
}
.rrv3-cwr-review-section h3 {
    margin: 0 0 12px;
    color: #1a365d;
}
.rrv3-cwr-kv {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #e5edf7;
}
.rrv3-cwr-kv:last-child { border-bottom: 0; }
.rrv3-cwr-kv label,
.rrv3-cwr-text-block label {
    color: #64748b;
    font-size: 11.5px;
    font-weight: 900;
}
.rrv3-cwr-text-block {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e5edf7;
}
.rrv3-cwr-text-block p { margin: 6px 0 0; }
.rrv3-cwr-review-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 20px 18px;
    background: rgba(255,255,255,.97);
    border-top: 1px solid #dbe3ef;
    backdrop-filter: blur(10px);
}
.rrv3-cwr-review-actions .rrv3-button { min-height: 44px; }
@media (max-width: 760px) {
    .rrv3-cwr-review-hero,
    .rrv3-cwr-review-grid,
    .rrv3-cwr-review-actions {
        padding-left: 14px;
        padding-right: 14px;
    }
    .rrv3-cwr-review-hero,
    .rrv3-cwr-review-grid {
        grid-template-columns: 1fr;
    }
    .rrv3-cwr-review-hero { flex-direction: column; }
    .rrv3-cwr-review-nte { text-align: left; }
    .rrv3-cwr-kv { grid-template-columns: 1fr; gap: 3px; }
    .rrv3-cwr-review-actions .rrv3-button { flex: 1 1 100%; justify-content: center; }
}

/* CWR contractor WhatsApp issuing panel */
.rrv3-cwr-whatsapp-panel {
    margin: 16px;
    padding: 16px;
    border: 1px solid #bbf7d0;
    border-radius: 16px;
    background: #f0fdf4;
    box-shadow: 0 8px 22px rgba(22, 101, 52, 0.10);
}
.rrv3-cwr-whatsapp-panel h3 {
    margin: 0 0 8px;
    color: #166534;
}
.rrv3-cwr-whatsapp-message {
    margin: 12px 0;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    background: #ffffff;
    overflow: auto;
}
.rrv3-cwr-whatsapp-message pre {
    margin: 0;
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
    color: #14532d;
}
.rrv3-cwr-whatsapp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
@media (max-width: 720px) {
    .rrv3-cwr-whatsapp-actions .rrv3-button {
        width: 100%;
        justify-content: center;
    }
}

.rrv3-cwr-complete-btn {
    border-color: #86efac !important;
    color: #166534 !important;
    background: #dcfce7 !important;
}

/* CWR accounts readiness view */
.rrv3-cwr-accounts-readiness .rrv3-cwr-stat-grid {
    margin-top: 14px;
}
.rrv3-cwr-accounts-readiness table td {
    vertical-align: top;
}

/* CWR service/scope line entry UI */
.rrv3-cwr-service-lines-section {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 72%);
}
.rrv3-cwr-service-lines-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}
.rrv3-cwr-service-lines-head h3 {
    margin: 0 0 4px;
    color: #1e3a8a;
}
.rrv3-cwr-service-lines-head p {
    margin: 0;
    color: #475569;
    font-size: 13px;
    font-weight: 650;
}
.rrv3-cwr-service-line-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.rrv3-cwr-service-lines-list {
    display: grid;
    gap: 12px;
}
.rrv3-cwr-service-line-row {
    border: 1px solid #c7d2fe;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(30, 64, 175, .07);
    overflow: hidden;
}
.rrv3-cwr-service-line-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #eef2ff;
    border-bottom: 1px solid #c7d2fe;
}
.rrv3-cwr-service-line-number {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #1d4ed8;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.rrv3-cwr-service-line-main {
    padding: 12px;
}
.rrv3-cwr-line-description textarea {
    min-height: 58px;
}
.rrv3-cwr-line-mini-grid {
    display: grid;
    grid-template-columns: minmax(80px, .7fr) minmax(100px, .9fr) minmax(150px, 1.2fr) minmax(130px, 1fr);
    gap: 10px;
    align-items: end;
}
.rrv3-cwr-line-rm-input input {
    min-width: 0;
}
.rrv3-cwr-line-amount {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #166534;
    font-weight: 900;
}
.rrv3-cwr-service-lines-foot {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px dashed #bfdbfe;
    color: #475569;
    font-weight: 800;
}
.rrv3-cwr-service-lines-foot strong {
    color: #166534;
    font-size: 16px;
}
@media (max-width: 820px) {
    .rrv3-cwr-service-lines-head {
        flex-direction: column;
    }
    .rrv3-cwr-service-line-actions,
    .rrv3-cwr-service-line-actions .rrv3-button {
        width: 100%;
    }
    .rrv3-cwr-service-line-actions .rrv3-button {
        justify-content: center;
    }
    .rrv3-cwr-line-mini-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 520px) {
    .rrv3-cwr-service-lines-section {
        padding: 12px;
        border-radius: 14px;
    }
    .rrv3-cwr-line-mini-grid {
        grid-template-columns: 1fr;
    }
    .rrv3-cwr-service-lines-foot {
        justify-content: space-between;
    }
}

/* CWR service/subcontractor catalog picker */
body.rrv3-cwr-modal-open {
    overflow: hidden;
}
.rrv3-cwr-catalog-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
}
.rrv3-cwr-catalog-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(3px);
}
.rrv3-cwr-catalog-picker-dialog {
    position: relative;
    width: min(920px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 28px));
    margin: 14px auto;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .30);
    overflow: hidden;
}
.rrv3-cwr-catalog-picker-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid #dbe3ef;
    background: linear-gradient(135deg, #eef2ff 0%, #ffffff 100%);
}
.rrv3-cwr-catalog-picker-head h3 {
    margin: 0 0 4px;
    color: #1e3a8a;
    font-size: 19px;
}
.rrv3-cwr-catalog-picker-head p {
    margin: 0;
    color: #475569;
    font-weight: 650;
}
.rrv3-cwr-catalog-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px 20px 8px;
}
.rrv3-cwr-catalog-search-row input[type="search"] {
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0 13px;
}
.rrv3-cwr-catalog-picker-note {
    margin: 0 20px 10px;
    padding: 9px 11px;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    border: 1px dashed #cbd5e1;
    font-size: 12.5px;
    font-weight: 700;
}
.rrv3-cwr-catalog-results {
    flex: 1;
    overflow: auto;
    display: grid;
    gap: 10px;
    padding: 0 20px 20px;
}
.rrv3-cwr-catalog-result-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 145px;
    gap: 14px;
    padding: 13px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}
.rrv3-cwr-catalog-result-main strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    margin-bottom: 5px;
}
.rrv3-cwr-catalog-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 7px;
}
.rrv3-cwr-catalog-result-meta span {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    font-size: 11px;
    font-weight: 850;
}
.rrv3-cwr-catalog-result-main p {
    margin: 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
}
.rrv3-cwr-catalog-result-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    text-align: right;
}
.rrv3-cwr-catalog-result-side strong {
    color: #166534;
    font-size: 16px;
}
.rrv3-cwr-catalog-result-side small {
    color: #64748b;
    font-weight: 800;
}
.rrv3-cwr-catalog-empty {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    color: #475569;
    font-weight: 750;
    text-align: center;
}
@media (max-width: 680px) {
    .rrv3-cwr-catalog-picker-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        margin: 8px auto;
        border-radius: 16px;
    }
    .rrv3-cwr-catalog-picker-head,
    .rrv3-cwr-catalog-search-row {
        grid-template-columns: 1fr;
        flex-direction: column;
        padding-left: 14px;
        padding-right: 14px;
    }
    .rrv3-cwr-catalog-picker-head .rrv3-button,
    .rrv3-cwr-catalog-search-row .rrv3-button {
        width: 100%;
        justify-content: center;
    }
    .rrv3-cwr-catalog-picker-note {
        margin-left: 14px;
        margin-right: 14px;
    }
    .rrv3-cwr-catalog-results {
        padding-left: 14px;
        padding-right: 14px;
    }
    .rrv3-cwr-catalog-result-card {
        grid-template-columns: 1fr;
    }
    .rrv3-cwr-catalog-result-side {
        align-items: stretch;
        text-align: left;
    }
    .rrv3-cwr-catalog-result-side .rrv3-button {
        width: 100%;
        justify-content: center;
    }
}

/* CWR saved service/scope line display */
.rrv3-cwr-line-summary {
    display: inline-block;
    max-width: 260px;
    color: #334155;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}
.rrv3-cwr-service-lines-display {
    margin-top: 12px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
}
.rrv3-cwr-service-lines-display-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    background: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
}
.rrv3-cwr-service-lines-display-head h4 {
    margin: 0;
    color: #1e3a8a;
    font-size: 15px;
}
.rrv3-cwr-service-lines-display-head span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
    font-size: 11px;
    font-weight: 900;
}
.rrv3-cwr-service-lines-table-wrap {
    overflow-x: auto;
}
.rrv3-cwr-service-lines-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}
.rrv3-cwr-service-lines-table th,
.rrv3-cwr-service-lines-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5edf7;
    text-align: left;
    vertical-align: top;
    font-size: 13px;
}
.rrv3-cwr-service-lines-table th {
    color: #475569;
    background: #f8fafc;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.rrv3-cwr-service-lines-table td small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-weight: 750;
}
.rrv3-cwr-service-lines-table tfoot td {
    background: #f8fafc;
    color: #475569;
    font-weight: 900;
}
.rrv3-cwr-service-lines-table tfoot td:last-child {
    color: #166534;
}
.rrv3-cwr-line-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e40af;
    font-weight: 900;
}
.rrv3-cwr-service-lines-empty {
    padding: 13px;
    color: #475569;
}
.rrv3-cwr-service-lines-empty strong {
    color: #92400e;
}
.rrv3-cwr-service-lines-empty p {
    margin: 5px 0 9px;
}
@media (max-width: 640px) {
    .rrv3-cwr-line-summary {
        max-width: 190px;
    }
    .rrv3-cwr-service-lines-display-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

.rrv3-cwr-alert-block {
    border-color: #fecaca;
    background: #fff7ed;
}
.rrv3-cwr-alert-block label {
    color: #9a3412;
}

.rrv3-cwr-status-note {
    display: inline-block;
    margin-top: 4px;
    color: #475569;
    font-weight: 800;
    font-size: 11px;
}

/* CWR timeline */
.rrv3-cwr-timeline-section {
    background: #ffffff;
}
.rrv3-cwr-timeline-list {
    display: grid;
    gap: 10px;
}
.rrv3-cwr-timeline-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #e5edf7;
}
.rrv3-cwr-timeline-item:last-child {
    border-bottom: 0;
}
.rrv3-cwr-timeline-dot {
    width: 11px;
    height: 11px;
    margin-top: 4px;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 0 0 0 4px #dbeafe;
}
.rrv3-cwr-timeline-item strong {
    display: block;
    color: #0f172a;
}
.rrv3-cwr-timeline-item small {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-weight: 800;
}
.rrv3-cwr-timeline-item p {
    margin: 5px 0 0;
    color: #475569;
}

/* CWR SBU approval WhatsApp share panel */
.rrv3-cwr-approval-share-panel {
    margin: 16px 0 18px;
    padding: 18px;
    border: 1px solid #bbf7d0;
    border-left: 5px solid #16a34a;
    border-radius: 18px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 78%);
    box-shadow: 0 10px 26px rgba(22, 163, 74, .10);
}
.rrv3-cwr-approval-share-panel h3 {
    margin: 0 0 8px;
    color: #166534;
}
.rrv3-cwr-approval-share-panel p {
    margin: 7px 0;
    color: #334155;
}
.rrv3-cwr-approval-url {
    margin-top: 12px;
}
.rrv3-cwr-approval-url label,
.rrv3-cwr-approval-message label {
    display: block;
    margin-bottom: 5px;
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.rrv3-cwr-approval-url input {
    width: 100%;
    min-height: 40px;
    border: 1px solid #86efac;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}
.rrv3-cwr-approval-message {
    margin-top: 12px;
}
.rrv3-cwr-approval-message pre {
    white-space: pre-wrap;
    overflow: auto;
    max-height: 280px;
    margin: 0;
    padding: 12px;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.45;
}
.rrv3-cwr-approval-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
}
@media (max-width: 640px) {
    .rrv3-cwr-approval-actions .rrv3-button,
    .rrv3-cwr-approval-actions a.rrv3-button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* Compact clickable CWR timeline pills */
.rrv3-cwr-timeline-section {
    background: #ffffff;
}
.rrv3-cwr-timeline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    align-items: stretch;
}
.rrv3-cwr-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    width: min(100%, 300px);
    min-height: 76px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(37, 99, 235, .08);
}
.rrv3-cwr-timeline-item:hover,
.rrv3-cwr-timeline-item:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
    outline: none;
}
.rrv3-cwr-timeline-dot {
    width: 11px;
    height: 11px;
    margin: 0;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 0 0 0 4px #dbeafe;
}
.rrv3-cwr-timeline-text {
    min-width: 0;
}
.rrv3-cwr-timeline-text strong,
.rrv3-cwr-timeline-text small,
.rrv3-cwr-timeline-text em {
    display: block;
}
.rrv3-cwr-timeline-text strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 1.2;
}
.rrv3-cwr-timeline-text small {
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
}
.rrv3-cwr-timeline-text em {
    margin-top: 2px;
    color: #475569;
    font-size: 11px;
    font-style: normal;
    line-height: 1.25;
}
.rrv3-cwr-timeline-arrow {
    color: #2563eb;
    font-weight: 1000;
    font-size: 18px;
}
.rrv3-cwr-scroll-highlight {
    animation: rrv3-cwr-target-pulse 1.4s ease-out 1;
}
@keyframes rrv3-cwr-target-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .34); }
    100% { box-shadow: 0 0 0 14px rgba(37, 99, 235, 0); }
}
@media (max-width: 640px) {
    .rrv3-cwr-timeline-list {
        gap: 9px;
    }
    .rrv3-cwr-timeline-item {
        width: 100%;
        border-radius: 18px;
    }
}

/* Flow arrows between CWR timeline pills + completed/pending colours */
.rrv3-cwr-timeline-list {
    gap: 12px 34px;
}
.rrv3-cwr-timeline-item {
    grid-template-columns: 24px minmax(0, 1fr);
    overflow: visible;
}
.rrv3-cwr-timeline-item:not(:last-child)::after {
    content: "→";
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 22px;
    font-weight: 1000;
    pointer-events: none;
}
.rrv3-cwr-timeline-arrow {
    display: none;
}
.rrv3-cwr-timeline-item.is-complete {
    border-color: #86efac;
    background: #f0fdf4;
    box-shadow: 0 5px 14px rgba(22, 163, 74, .10);
}
.rrv3-cwr-timeline-item.is-complete .rrv3-cwr-timeline-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #ffffff;
    background: #16a34a;
    box-shadow: 0 0 0 4px #dcfce7;
    font-size: 13px;
    font-weight: 1000;
}
.rrv3-cwr-timeline-item.is-complete .rrv3-cwr-timeline-text strong {
    color: #166534;
}
.rrv3-cwr-timeline-item.is-pending {
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: 0 5px 14px rgba(100, 116, 139, .08);
}
.rrv3-cwr-timeline-item.is-pending .rrv3-cwr-timeline-dot {
    background: #94a3b8;
    box-shadow: 0 0 0 4px #e2e8f0;
}
.rrv3-cwr-timeline-item.is-alert {
    border-color: #fca5a5;
    background: #fff7ed;
    box-shadow: 0 5px 14px rgba(220, 38, 38, .10);
}
.rrv3-cwr-timeline-item.is-alert .rrv3-cwr-timeline-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #ffffff;
    background: #dc2626;
    box-shadow: 0 0 0 4px #fee2e2;
    font-size: 13px;
    font-weight: 1000;
}
.rrv3-cwr-timeline-item.is-alert .rrv3-cwr-timeline-text strong {
    color: #991b1b;
}
@media (max-width: 640px) {
    .rrv3-cwr-timeline-list {
        gap: 26px;
    }
    .rrv3-cwr-timeline-item:not(:last-child)::after {
        content: "↓";
        right: 50%;
        top: auto;
        bottom: -24px;
        transform: translateX(50%);
    }
}

/* 1607-07: CWR vendor quotation attachment */
.rrv3-cwr-vendor-quote-box {
    margin-top: 16px;
    padding: 14px;
    border: 1px dashed #93c5fd;
    border-radius: 14px;
    background: #f8fbff;
}
.rrv3-cwr-vendor-quote-box h3 {
    margin-top: 0;
    color: #0f172a;
}
.rrv3-cwr-vendor-quote-box h3 small {
    color: #64748b;
    font-weight: 600;
}
.rrv3-cwr-existing-vendor-quote {
    margin: 10px 0 12px;
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
}
.rrv3-cwr-vendor-quote-link {
    font-weight: 800;
    color: #2563eb;
    text-decoration: none;
}
.rrv3-cwr-vendor-quote-link:hover {
    text-decoration: underline;
}
html.rrv3-dark-mode .rrv3-cwr-vendor-quote-box,
html.rrv3-dark-mode .rrv3-cwr-existing-vendor-quote {
    background: #0f172a;
    border-color: #334155;
}
html.rrv3-dark-mode .rrv3-cwr-vendor-quote-box h3 {
    color: #e2e8f0;
}
.rrv3-cwr-vendor-quote-preview {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    background: #f0fdf4;
    color: #14532d;
    font-size: 12px;
    line-height: 1.45;
}
.rrv3-cwr-vendor-quote-preview div + div {
    margin-top: 4px;
}
html.rrv3-dark-mode .rrv3-cwr-vendor-quote-preview {
    background: #052e16;
    border-color: #166534;
    color: #dcfce7;
}
