body { background: #f4f6f9; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.top-bar {
    background: #2c3e50; color: #fff;
    padding: 10px 24px;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
}
.top-bar.staff { background: #1f4e5f; }
.top-bar .brand { font-size: 18px; font-weight: 600; letter-spacing: 0.5px; }
.top-bar .user-info { font-size: 13px; color: #bdc3c7; }
.top-bar a { color: #bdc3c7; text-decoration: none; font-size: 13px; }
.top-bar a:hover { color: #fff; }

.rp-nav { background: #fff; border-bottom: 1px solid #dee2e6; padding: 0 16px; display: flex; flex-wrap: wrap; }
.rp-nav a {
    padding: 10px 16px; font-size: 14px; color: #6c757d; text-decoration: none;
    border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.rp-nav a:hover { color: #2c3e50; }
.rp-nav a.active { color: #2c3e50; border-bottom-color: #3498db; font-weight: 500; }
.rp-count {
    display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px;
    background: #e74c3c; color: #fff; border-radius: 9px; font-size: 11px; font-weight: 600; text-align: center;
}

.content { max-width: 960px; margin: 28px auto; padding: 0 16px; }
.content.wide { max-width: 1200px; }
.page-title { font-size: 22px; font-weight: 600; color: #2c3e50; margin-bottom: 6px; }
.page-sub { font-size: 13px; color: #7f8c8d; margin-bottom: 20px; }
.section-card {
    background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08);
    padding: 20px 24px; margin-bottom: 20px;
}
.section-title { font-size: 15px; font-weight: 600; color: #2c3e50; margin-bottom: 14px; }
label { font-size: 13px; font-weight: 500; color: #495057; }
.form-control, .form-select { font-size: 13px; }
/* The vendored Bootstrap is 4.6, which has no .form-select; size it like .form-control */
.form-select {
    display: block; width: 100%; max-width: 100%; padding: .375rem .75rem; line-height: 1.5;
    color: #495057; background-color: #fff; border: 1px solid #ced4da; border-radius: .25rem;
}
.form-select-sm { padding: .25rem .5rem; font-size: 12px; }
.rp-upload-item { border: 1px solid #e3e8ee; border-radius: 6px; padding: 12px 14px; margin-bottom: 10px; background: #fbfcfd; }
.btn { font-size: 13px; }
.alert { font-size: 13px; }
.empty-note { font-size: 13px; color: #aaa; margin-top: 8px; }
.muted { color: #7f8c8d; font-size: 12px; }

.history-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.history-table th { background: #f8f9fa; padding: 7px 10px; text-align: left; font-weight: 600; color: #495057; border-bottom: 2px solid #dee2e6; white-space: nowrap; }
.history-table td { padding: 7px 10px; border-bottom: 1px solid #f0f0f0; color: #343a40; vertical-align: top; }
.history-table tr:last-child td { border-bottom: none; }
.history-table tr.clickable { cursor: pointer; }
.history-table tr.clickable:hover td { background: #f8f9fa; }
.table-scroll { overflow-x: auto; }

.rp-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pid-badge { display: inline-block; background: #e8f4fd; color: #2980b9; font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 600; }
.overdue { color: #c0392b; font-weight: 600; }

.law-box { background: #f8f9fa; border-left: 3px solid #3498db; padding: 10px 14px; font-size: 13px; margin: 10px 0; }
.law-box .law-title { font-weight: 600; color: #2c3e50; margin-bottom: 4px; }

.rp-thread { max-height: 420px; overflow-y: auto; padding: 4px 0; }
.rp-msg { background: #f1f3f5; border-radius: 8px; padding: 8px 12px; margin: 0 40px 10px 0; font-size: 13px; }
.rp-msg-mine { background: #e8f4fd; margin: 0 0 10px 40px; }
.rp-msg-meta { font-size: 11px; color: #7f8c8d; margin-bottom: 3px; }

.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 12px 18px; min-width: 150px; }
.stat .num { font-size: 22px; font-weight: 600; color: #2c3e50; }
.stat .lbl { font-size: 12px; color: #7f8c8d; }

.agreement-body { border: 1px solid #dee2e6; border-radius: 6px; padding: 16px; max-height: 420px; overflow-y: auto; font-size: 14px; background: #fff; }
.rp-feedback { margin-top: 10px; }

/* Guided flow */
.rp-step { display: flex; gap: 14px; margin-bottom: 18px; }
.rp-step-num {
    flex: 0 0 26px; height: 26px; border-radius: 50%; background: #3498db; color: #fff;
    font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.rp-step-body { flex: 1; min-width: 0; }
.rp-consent-upload { border: 1px dashed #e67e22; background: #fff8f0; border-radius: 6px; padding: 10px 14px; margin-top: 10px; }
.rp-attention { background: #fff8f0; border-left: 4px solid #e67e22; border-radius: 6px; padding: 12px 16px; margin-bottom: 20px; font-size: 13px; }
.rp-attention-title { font-weight: 600; color: #c0640f; margin-bottom: 6px; }
.rp-attention-item { padding: 3px 0; }
.rp-attention-item a { margin-left: 6px; }
.history-table tr.rp-row-new td { background: #eafaf1; }
.rp-dropzone {
    display: block; border: 2px dashed #cfd8e3; border-radius: 8px; padding: 22px; text-align: center;
    color: #6c757d; cursor: pointer; font-size: 14px; font-weight: 400; margin: 0;
}
.rp-dropzone i { font-size: 28px; color: #3498db; margin-bottom: 6px; }
.rp-dropzone.over, .rp-dropzone:hover { border-color: #3498db; background: #f4f9fd; }
.rp-link { color: #3498db; text-decoration: underline; }

/* Case stepper */
.rp-stepper { display: flex; margin: 6px 0 20px; }
.rp-stepper-item { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; font-size: 12px; color: #95a5a6; }
.rp-stepper-item::before { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: #dee2e6; z-index: 0; }
.rp-stepper-item:first-child::before { display: none; }
.rp-stepper-item.done::before, .rp-stepper-item.current::before { background: #3498db; }
.rp-stepper-dot { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid #dee2e6; display: flex; align-items: center;
    justify-content: center; font-weight: 600; z-index: 1; font-size: 12px; }
.rp-stepper-item.done .rp-stepper-dot { background: #27ae60; border-color: #27ae60; color: #fff; }
.rp-stepper-item.current .rp-stepper-dot { border-color: #3498db; color: #3498db; }
.rp-stepper-item.current { color: #2c3e50; font-weight: 600; }
.rp-stepper-label { margin-top: 4px; text-align: center; }
.rp-stepper.compact { margin: 0; min-width: 150px; }
.rp-stepper.compact .rp-stepper-dot { width: 18px; height: 18px; font-size: 9px; }
.rp-stepper.compact .rp-stepper-item::before { top: 9px; }

/* Collapsible case sections */
.rp-section { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 12px; }
.rp-section-head { padding: 14px 20px; cursor: pointer; display: flex; align-items: center; gap: 12px; font-weight: 600; color: #2c3e50; font-size: 15px; }
.rp-section-status { margin-left: auto; font-weight: 400; font-size: 12px; color: #7f8c8d; }
.rp-section-num { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #3498db; color: #3498db; display: inline-flex; align-items: center;
    justify-content: center; font-size: 12px; flex: 0 0 26px; }
.rp-section-num.done { background: #27ae60; border-color: #27ae60; color: #fff; }
.rp-section-body { display: none; padding: 0 20px 18px 58px; }
.rp-section.open .rp-section-body { display: block; }
.rp-group-title { font-size: 12px; font-weight: 600; text-transform: uppercase; color: #7f8c8d; letter-spacing: .5px; margin-bottom: 6px; }
.rp-tip { background: #f4f9fd; border-left: 3px solid #3498db; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; border-radius: 4px; }
.rp-line { padding: 4px 0; font-size: 13px; }
.rp-file-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.rp-file-row .rp-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-file-row .form-select { width: 230px; }

/* Service cards */
.rp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.rp-card { border: 2px solid #e3e8ee; border-radius: 8px; padding: 12px 14px; cursor: pointer; background: #fff; }
.rp-card:hover { border-color: #aed6f1; }
.rp-card.selected { border-color: #3498db; background: #f4f9fd; }
.rp-card-title { font-weight: 600; font-size: 14px; color: #2c3e50; }
.rp-card-text { font-size: 12px; color: #6c757d; margin-top: 4px; }
.rp-card-fee { font-size: 12px; color: #16a085; margin-top: 6px; font-weight: 600; }
.rp-card-other { border-style: dashed; }

.rp-request { border: 1px solid #e3e8ee; border-radius: 6px; padding: 10px 14px; margin-bottom: 10px; }
.rp-request-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rp-state { font-size: 13px; font-weight: 600; white-space: nowrap; }
.rp-doc { border-top: 1px solid #f0f0f0; margin-top: 8px; padding-top: 6px; font-size: 13px; }
.rp-doc summary { cursor: pointer; color: #2c3e50; }
.rp-doc-text { white-space: pre-wrap; font-size: 12px; background: #fbfcfd; border: 1px solid #eef1f4; padding: 10px; border-radius: 4px; max-height: 480px; overflow: auto; margin-top: 6px; }

/* Ask panel */
.rp-ask-btn { position: fixed; right: 20px; bottom: 20px; z-index: 50; background: #2c3e50; color: #fff; border: none; border-radius: 22px;
    padding: 10px 18px; font-size: 14px; box-shadow: 0 3px 10px rgba(0,0,0,.2); }
.rp-ask { position: fixed; right: 20px; bottom: 74px; width: 380px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 100px);
    background: #fff; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.25); z-index: 51; display: none; flex-direction: column; }
.rp-ask.open { display: flex; }
.rp-ask-head { background: #2c3e50; color: #fff; padding: 10px 14px; border-radius: 10px 10px 0 0; display: flex; justify-content: space-between; font-size: 14px; }
.rp-ask-head button { background: none; border: none; color: #fff; font-size: 18px; line-height: 1; }
.rp-ask-log { flex: 1; overflow-y: auto; padding: 10px; }
.rp-ask-hint { font-size: 12px; color: #7f8c8d; margin-bottom: 10px; }
.rp-ask-msg { padding: 8px 10px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; max-width: 90%; }
.rp-ask-msg.me { background: #e8f4fd; margin-left: auto; }
.rp-ask-msg.bot { background: #f1f3f5; }
.rp-ask-proposal { border: 1px solid #aed6f1; background: #fff; border-radius: 6px; padding: 8px; margin-top: 6px; }
.rp-ask-fb { margin-top: 4px; font-size: 11px; }
.rp-ask-fb a { color: #bbb; margin-right: 6px; }
.rp-ask-fb a.on { color: #3498db; }
.rp-ask-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #eee; }
.rp-ask-form textarea { flex: 1; font-size: 13px; border: 1px solid #ddd; border-radius: 6px; padding: 6px; resize: none; }

/* Staff scoring */
.rp-score { display: inline-block; min-width: 46px; text-align: center; padding: 3px 8px; border-radius: 12px; font-weight: 700; font-size: 13px; }
.rp-score.low { background: #eafaf1; color: #1e8449; }
.rp-score.mid { background: #fef5e7; color: #b9770e; }
.rp-score.high { background: #fdedec; color: #c0392b; }
.rp-check { font-size: 13px; padding: 3px 0; }
.rp-check i { width: 18px; }
.rp-rec { border-left: 3px solid #3498db; padding: 6px 10px; margin-bottom: 6px; background: #fbfcfd; font-size: 13px; }
.rp-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
@media (max-width: 600px) {
    .rp-section-body { padding-left: 20px; }
    .rp-stepper-label { display: none; }
}

/* Organization-level notice (e.g. agreements still to sign) under the client menu */
.rp-org-banner { background: #fff8f0; border-bottom: 1px solid #f5d6b3; color: #8a4b0f; padding: 8px 24px; font-size: 13px; }
.rp-org-banner a { font-weight: 600; margin-left: 6px; }
