/**
 * Agent Dashboard — Specific Overrides + Responsive Layout
 * Sits on top of manager-portal.css.
 * Extracted from widget-dashboard.php inline <style> block.
 */

.map-form-group {
    position: relative;
}

.map-agency-suggestions {
    display: none;
    position: absolute;
    z-index: 50;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--portal-border, #dfe7ef);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(20,48,80,0.14);
    padding: 6px;
}

.map-agency-suggestion {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--portal-text, #1e3a5f);
    cursor: pointer;
    display: block;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    padding: 9px 10px;
    text-align: left;
    border-radius: 6px;
}

.map-agency-suggestion span,
.map-agency-suggestion small {
    display: block;
}

.map-agency-suggestion small {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 10px;
    font-weight: 600;
    margin-top: 2px;
}

.map-agency-suggestion:hover,
.map-agency-suggestion:focus {
    background: #eef3f8;
    color: var(--portal-primary, #1e3a5f);
    outline: none;
}

.map-agency-suggestion-empty {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 12px;
    padding: 8px 10px;
}

.map-case-submit-notice {
    display: grid;
    gap: 12px;
    justify-items: stretch;
    max-width: 760px;
    margin-top: 12px;
    padding: 13px 15px;
    border: 1px solid var(--portal-border, #d8e0e7);
    border-radius: 8px;
    background: #fff;
    color: var(--portal-text, #253444);
    box-shadow: 0 8px 22px rgba(31, 54, 78, 0.08);
}

.map-case-submit-notice-success {
    border-left: 4px solid #1a7a5e;
    background: #f3fbf7;
}

.map-case-submit-notice strong {
    color: #1a7a5e;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.map-case-submit-notice span {
    color: var(--portal-soft-text, #53666f);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.map-case-submit-notice .map-btn-small {
    margin-top: 4px;
}

.map-case-confirm-title {
    display: grid;
    gap: 4px;
}

.map-case-confirm-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.map-case-confirm-row,
.map-case-confirm-next {
    background: #fff;
    border: 1px solid #dce8e2;
    border-radius: 8px;
    padding: 10px 12px;
}

.map-case-confirm-row span,
.map-case-confirm-next span {
    color: var(--portal-soft-text, #53666f);
    display: block;
    font-size: 12px;
    font-weight: 700;
}

.map-case-confirm-row strong,
.map-case-confirm-next strong {
    color: var(--portal-primary, #1e3a5f);
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-top: 2px;
}

.map-case-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.map-dashboard-section-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.map-dashboard-section-head .map-agent-section-title {
    margin: 0;
}

.map-agent-overview-cards {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    margin-bottom: 0;
}

.map-dashboard-muted {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 13px;
    margin: 0;
    padding: 24px 0;
    text-align: center;
}

.map-dashboard-muted-error {
    color: #c0392b;
}

.map-dashboard-empty {
    align-items: flex-start;
    background: #f8fafc;
    border: 1px dashed var(--portal-border, #d8e0e7);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 16px;
}

.map-dashboard-empty strong {
    color: var(--portal-primary, #1e3a5f);
    font-size: 14px;
    font-weight: 800;
}

.map-dashboard-empty span {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 13px;
}

.map-dashboard-competition-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.map-dashboard-competition-card {
    background: #fff;
    border: 1px solid var(--portal-border, #d8e0e7);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 14px;
}

.map-dashboard-competition-top {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.map-dashboard-competition-top strong {
    color: var(--portal-primary, #1e3a5f);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.map-dashboard-pill {
    border-radius: 999px;
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 9px;
}

.map-dashboard-pill-success {
    background: #d1f2eb;
    color: #1a7a5e;
}

.map-dashboard-pill-neutral {
    background: #f1f2f6;
    color: var(--portal-soft-text, #6f7f86);
}

.map-dashboard-competition-target {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 12px;
    font-weight: 700;
}

.map-dashboard-progress-row {
    align-items: center;
    color: var(--portal-soft-text, #6f7f86);
    display: flex;
    font-size: 11px;
    gap: 8px;
    justify-content: space-between;
}

.map-dashboard-progress-row strong {
    color: var(--portal-primary, #1e3a5f);
    font-weight: 800;
}

.map-dashboard-progress-bar {
    background: #f1f2f6;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.map-dashboard-progress-bar span {
    background: var(--portal-primary, #1e3a5f);
    border-radius: inherit;
    display: block;
    height: 100%;
}

.map-dashboard-competition-card p {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 11px;
    line-height: 1.45;
    margin: 0;
}

.map-agent-section {
    background: #fff;
    border: 1px solid var(--portal-border, #e1e4e8);
    border-radius: 10px;
    padding: 22px 25px;
    margin-bottom: 20px;
    box-shadow: var(--portal-shadow, 0 4px 15px rgba(0,0,0,0.05));
}

.map-agent-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--portal-muted-text, #5f7078);
    margin: 0 0 16px 0;
}

.map-party-list {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.map-party-row {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.7fr) auto;
}

.map-party-row .map-form-group {
    margin-bottom: 0;
}

.map-party-add,
.map-party-remove {
    min-height: 38px;
}

.map-party-add {
    margin: 0 0 18px;
}

.map-case-component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.map-case-component-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--portal-border, #d8e0e7);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    color: var(--portal-text, #1e3a5f);
}

.map-case-component-option input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.map-case-component-option span {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
}

.map-case-component-option small {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef6ff;
    color: var(--portal-primary, #1e3a5f);
    font-size: 12px;
    font-weight: 800;
}

.map-case-component-option:has(input:checked) {
    border-color: var(--portal-primary, #1e3a5f);
    background: #f3f8fd;
}

.map-agent-sidebar-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    margin: 0 0 16px;
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.18);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}

.map-agent-sidebar-avatar img,
.map-profile-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.map-profile-photo-editor {
    display: flex;
    gap: 22px;
    align-items: center;
}

.map-profile-photo-preview {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    flex: 0 0 112px;
    background: #eef5fb;
    border: 1px solid #dce6f0;
    color: var(--portal-primary, #1e3a5f);
    font-size: 26px;
    font-weight: 800;
}

.map-profile-photo-controls {
    min-width: 0;
}

.map-profile-photo-controls p {
    margin: 0 0 10px;
    color: var(--portal-soft-text, #6f7f86);
    font-size: 13px;
}

.map-profile-photo-current a {
    color: var(--portal-primary, #1e3a5f);
    font-weight: 700;
}

.map-profile-photo-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
    color: var(--portal-soft-text, #6f7f86);
    font-size: 12px;
}

.map-profile-photo-upload-picker {
    margin: 2px 0 8px;
}

.map-comp-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 22px;
    background: #fff;
    border: 1px solid var(--portal-border, #e1e4e8);
    border-radius: 12px;
    padding: 22px;
    box-shadow: var(--portal-shadow, 0 4px 15px rgba(0,0,0,0.05));
}

.map-comp-card-compact {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    padding: 18px 22px;
}

.map-comp-card-image {
    align-self: start;
}

.map-comp-image-btn,
.map-comp-image-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    border: 1px solid #dce3ea;
    background: #f5f7fa;
    overflow: hidden;
    padding: 0;
    display: grid;
    place-items: center;
}

.map-comp-image-btn {
    cursor: pointer;
}

.map-comp-image-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.18s ease;
}

.map-comp-image-btn:hover img {
    transform: scale(1.04);
}

.map-comp-image-placeholder span {
    color: var(--portal-muted-text, #5f7078);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.map-comp-card-body {
    min-width: 0;
}

.map-comp-image-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    background: rgba(20, 31, 43, 0.72);
    padding: 24px;
}

.map-comp-image-modal-inner {
    position: relative;
    width: min(760px, 92vw);
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.map-comp-image-modal-inner img {
    width: 100%;
    max-height: 76vh;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    background: #f5f7fa;
}

.map-comp-image-modal-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #1e3a5f;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.map-comp-image-modal-title {
    margin-top: 10px;
    color: #5f7190;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.map-rule-summary {
    background: #fff8e1;
    border: 1px solid #ffc74d;
    border-radius: 8px;
    color: var(--portal-muted-text, #5f7078);
    font-size: 12px;
    line-height: 1.45;
    margin-top: 12px;
    padding: 12px;
}

.map-rule-summary-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 10px;
}

.map-rule-summary-head strong {
    color: #e65100;
    font-size: 13px;
    font-weight: 800;
}

.map-rule-summary-head span {
    background: #fff;
    border: 1px solid #ffe082;
    border-radius: 999px;
    color: var(--portal-primary, #1e3a5f);
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
}

.map-rule-paths {
    display: grid;
    gap: 8px;
}

.map-rule-path {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid #ffe082;
    border-radius: 7px;
    padding: 10px;
}

.map-rule-path-title {
    color: var(--portal-primary, #1e3a5f);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.map-rule-detail {
    display: grid;
    gap: 6px;
    grid-template-columns: 120px minmax(0, 1fr);
    padding: 3px 0;
}

.map-rule-detail span {
    color: var(--portal-muted-text, #5f7078);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.map-rule-detail strong {
    color: var(--portal-primary, #1e3a5f);
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* Submissions table inside agent dashboard */
.map-portal-table td,
.map-portal-table th {
    padding: 12px 14px;
}

.map-agent-submissions-table {
    table-layout: fixed;
}

.map-agent-submissions-table .map-col-case {
    width: 32%;
}

.map-agent-submissions-table .map-col-finance {
    width: 20%;
}

.map-agent-submissions-table .map-col-combined-status {
    width: 20%;
}

.map-agent-submissions-table .map-col-date {
    width: 12%;
}

.map-agent-submissions-table .map-col-action {
    width: 16%;
    text-align: left !important;
}

.map-agent-submissions-table th.map-col-action,
.map-agent-submissions-table td.map-col-action {
    text-align: left !important;
}

.map-agent-submissions-table th,
.map-agent-submissions-table td {
    text-align: left;
    vertical-align: top;
    overflow-wrap: normal;
    padding-top: 10px;
    padding-bottom: 10px;
}

.map-agent-submissions-table .map-case-title {
    display: block;
    color: #5f7190;
    line-height: 1.35;
    margin-bottom: 6px;
}

.map-role-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
}

.map-role-badge-main {
    background: #eaf4fd;
    color: #1e3a5f;
}

.map-role-badge-co {
    background: #f1f2f6;
    color: var(--portal-soft-text, #6f7f86);
}

.map-agent-submissions-table .map-col-finance span {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 12px;
}

.map-action-stack {
    display: inline-flex;
    flex-direction: column;
    gap: 7px;
    align-items: stretch;
    justify-content: flex-start;
    min-width: 118px;
    max-width: 100%;
}

.map-action-stack .map-btn-small {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    font-size: 11px;
    line-height: 1.2;
}

.map-agent-submissions-table .map-col-action .map-action-stack {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    align-items: stretch !important;
}

.map-agent-submissions-table .map-col-action .map-action-stack .map-btn-small {
    width: 96px !important;
    min-width: 0 !important;
    max-width: 96px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

.map-docs-view-btn {
    background: #f5f7fa !important;
    border: 1px solid #dce3ea !important;
    color: #1e3a5f !important;
}

.map-case-view-panel {
    padding: 22px 26px;
    background: #fbfcfe;
    text-align: left;
}

.map-case-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    justify-items: stretch;
}

.map-case-detail-card {
    background: #fff;
    border: 1px solid #e8edf2;
    border-radius: 8px;
    padding: 16px 18px;
    text-align: left;
    justify-items: start;
}

.map-case-view-panel,
.map-case-view-panel p,
.map-case-view-panel span,
.map-case-view-panel strong,
.map-case-view-panel small,
.map-case-detail-card,
.map-case-detail-card h4,
.map-case-detail-item,
.map-case-detail-item span,
.map-case-detail-item strong {
    text-align: left !important;
}

.map-case-detail-card h4 {
    margin: 0 0 12px;
    color: var(--portal-muted-text, #5f7078);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: left;
}

.map-case-detail-item {
    display: grid;
    grid-template-columns: minmax(170px, 0.35fr) minmax(0, 1fr);
    gap: 18px;
    padding: 7px 0;
    border-top: 1px solid #f0f3f6;
    text-align: left;
}

.map-case-detail-item:first-of-type {
    border-top: 0;
}

.map-case-detail-item span {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 12px;
    text-align: left;
}

.map-case-detail-item strong {
    color: #4f617c;
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
}

.map-case-solicitors-card,
.map-case-documents-card {
    margin-top: 14px;
}

.map-case-solicitor-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.map-case-documents-card .map-docs-panel {
    padding: 0;
}

.map-approved-doc-note {
    margin: 0 0 14px;
    color: var(--portal-soft-text, #6f7f86);
    font-size: 12px;
    line-height: 1.5;
}

.map-supporting-doc-guide {
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--portal-border, #dfe7ef);
    border-radius: 8px;
    background: #f8fbff;
}

.map-supporting-doc-guide-head {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: baseline;
    margin-bottom: 10px;
}

.map-supporting-doc-guide-head strong {
    color: var(--portal-primary, #1e3a5f);
    font-size: 13px;
    font-weight: 800;
}

.map-supporting-doc-guide-head span {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 12px;
    font-weight: 600;
}

.map-supporting-doc-guide-list {
    display: grid;
    gap: 8px;
}

.map-supporting-doc-guide-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border: 1px solid #dfe7ef;
    border-radius: 7px;
    background: #fff;
}

.map-supporting-doc-guide-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--portal-text, #1e3a5f);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.map-supporting-doc-info {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 2px solid #007bff;
    border-radius: 50%;
    color: #007bff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.map-supporting-doc-example-btn {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--portal-primary, #1e3a5f);
    color: #fff !important;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none !important;
    white-space: nowrap;
}

.map-file-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.map-file-picker {
    min-height: 34px;
}

.map-file-picker input {
    display: none;
}

.map-file-picker-small {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 11px;
}

.map-file-picked-text {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 12px;
    line-height: 1.3;
}

.map-edit-documents-panel .map-add-doc-form {
    padding-top: 2px;
}

.map-doc-empty {
    margin: 0 0 14px;
    color: #a7b1c1;
    font-size: 12px;
}

.map-doc-upload-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr);
    gap: 12px;
    align-items: start;
    margin-top: 12px;
}

.map-doc-upload-zone {
    display: grid;
    gap: 7px;
    align-content: center;
    min-height: 96px;
    padding: 18px 22px;
    border: 2px dashed #c3d2e4;
    border-radius: 10px;
    background: #f8fbff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.map-doc-upload-zone:hover,
.map-doc-upload-zone.is-dragging {
    border-color: #1e3a5f;
    background: #eef6ff;
    box-shadow: 0 6px 18px rgba(30,58,95,0.08);
}

.map-doc-upload-zone input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.map-doc-upload-title {
    color: #1e3a5f;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.map-doc-upload-hint {
    color: var(--portal-muted-text, #5f7078);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.map-doc-upload-zone .map-file-picked-text {
    color: #4f617c;
    font-size: 12px;
    font-weight: 800;
}

.map-case-file-choose-btn {
    margin-top: 10px;
}

.map-case-file-queue {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}

.map-case-file-queue-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--portal-border, #dfe7ef);
    border-radius: 7px;
    background: #fff;
}

.map-case-file-queue-name {
    color: var(--portal-text, #1e3a5f);
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.map-case-file-queue-size {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.map-case-file-remove {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 11px;
}

.map-doc-upload-btn {
    align-self: center;
    min-width: 128px;
    min-height: 36px;
    padding: 8px 12px !important;
    font-size: 12px !important;
}

.map-doc-msg {
    grid-column: 1 / -1;
    min-height: 16px;
    color: var(--portal-soft-text, #6f7f86);
    font-size: 12px;
    line-height: 1.35;
}

#map-cancel-edit-btn {
    background: #f1f2f6 !important;
    color: var(--portal-soft-text, #6f7f86) !important;
    border: 1px solid var(--portal-border, #d6dde6) !important;
}

.map-solicitor-rows {
    display: grid;
    gap: 14px;
}

.map-solicitor-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
    gap: 16px;
    align-items: end;
}

.map-solicitor-row .map-form-group {
    margin-bottom: 0;
}

/* CTOS */
.map-ctos-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.map-ctos-link-input {
    width: 100%;
    min-width: 0 !important;
    min-height: 40px;
    color: var(--portal-text, #253444);
    font-size: 13px;
    font-weight: 600;
}

.map-ctos-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.map-ctos-section-head .map-agent-section-title {
    margin: 0;
}

.map-ctos-refresh-msg {
    display: none;
    color: var(--portal-soft-text, #53666f);
    font-size: 13px;
    margin-bottom: 10px;
}

.map-portal-wrapper .map-ctos-request-card {
    display: grid;
    grid-template-columns: minmax(240px, 1.35fr) minmax(150px, .55fr) minmax(190px, .72fr);
    gap: 14px;
    align-items: start;
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 1px solid var(--portal-border, #d8e0e7);
    border-radius: 8px;
    background: #fff;
    color: var(--portal-text, #253444);
}

.map-portal-wrapper .map-ctos-request-card > * {
    align-self: start;
    min-width: 0;
}

.map-portal-wrapper .map-ctos-request-main {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.map-portal-wrapper .map-ctos-request-main strong {
    color: var(--portal-primary, #1e3a5f);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
}

.map-portal-wrapper .map-ctos-request-card span {
    color: var(--portal-soft-text, #53666f);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.map-portal-wrapper .map-ctos-request-status {
    display: grid;
    justify-items: start;
    gap: 6px;
}

.map-portal-wrapper .map-status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #e9f4ff;
    color: var(--portal-primary, #1e3a5f) !important;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    padding: 6px 10px;
}

.map-portal-wrapper .map-ctos-request-actions {
    display: grid;
    gap: 8px;
    justify-items: stretch;
    align-content: start;
}

.map-portal-wrapper .map-ctos-action-row {
    display: grid;
    gap: 8px;
}

.map-portal-wrapper .map-ctos-request-actions .map-btn-small,
.map-portal-wrapper .map-ctos-action-row .map-btn-small {
    width: 100%;
    min-height: 38px;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.2;
}

.map-portal-wrapper .map-ctos-action-secondary {
    width: 100%;
    background: var(--portal-primary, #1e3a5f) !important;
    color: #fff !important;
    text-decoration: none !important;
}

.map-portal-wrapper .map-ctos-action-warning {
    background: #ffca57 !important;
    color: var(--portal-text, #253444) !important;
}

.map-portal-wrapper .map-ctos-action-light {
    background: #eef3f8 !important;
    color: var(--portal-primary, #1e3a5f) !important;
    border: 1px solid var(--portal-border, #d8e0e7) !important;
    text-decoration: none !important;
}

.map-portal-wrapper .map-ctos-note {
    color: var(--portal-soft-text, #53666f);
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
}

/* ─── Responsive layout ──────────────────────────────────── */

/* Tablet: collapse sidebar to icon strip */
@media (max-width: 900px) {
    .map-portal-wrapper {
        border-radius: 8px;
    }

    .map-portal-sidebar {
        width: 60px;
        min-width: 60px;
    }

    .map-sidebar-header {
        padding: 20px 10px;
        text-align: center;
    }

    .map-agent-sidebar-avatar {
        width: 38px;
        height: 38px;
        margin: 0 auto;
        font-size: 12px;
    }

    /* Hide the text name, keep the header visible */
    .map-sidebar-header h3,
    .map-sidebar-header p {
        display: none;
    }

    .map-sidebar-nav li {
        padding: 16px 0;
        justify-content: center;
        border-left: none;
        border-bottom: 3px solid transparent;
        flex-direction: column;
        gap: 2px;
        font-size: 0; /* hide label text */
    }

    .map-sidebar-nav li .map-notification-badge {
        margin-left: 0;
        margin-top: 2px;
    }

    .map-sidebar-nav li span.dashicons {
        margin-right: 0;
        font-size: 20px;
    }

    .map-sidebar-nav li.active {
        border-left: none;
        border-bottom-color: var(--portal-hover);
        background: rgba(255,255,255,0.08);
    }

    .map-sidebar-footer {
        padding: 10px 6px;
    }

    .map-logout-btn span:not(.dashicons) {
        display: none;
    }

    .map-workspace-header {
        padding: 18px 20px;
    }

    #map-workspace-content {
        padding: 20px;
    }

    .map-registration-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .map-stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .map-agent-overview-cards,
    .map-dashboard-competition-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile: stack sidebar on top of content */
@media (max-width: 600px) {
    .map-portal-wrapper {
        flex-direction: column;
        border-radius: 0;
        box-shadow: none;
    }

    .map-portal-sidebar {
        width: 100%;
        min-width: 0;
        flex-direction: column;
    }

    /* Hide the greeting, show only the nav */
    .map-sidebar-header {
        display: none;
    }

    .map-sidebar-nav ul {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0;
        gap: 0;
        white-space: nowrap;
    }

    .map-sidebar-nav li {
        flex: 0 0 auto;
        flex-direction: column;
        gap: 3px;
        padding: 12px 14px;
        font-size: 10px;
        border-left: none;
        border-bottom: 3px solid transparent;
        justify-content: center;
        align-items: center;
    }

    .map-sidebar-nav li .map-notification-badge {
        margin-left: 0;
        margin-top: 1px;
    }

    .map-sidebar-nav li span.dashicons {
        margin-right: 0;
        font-size: 18px;
    }

    .map-sidebar-nav li.active {
        border-left: none;
        border-bottom-color: var(--portal-hover);
        background: rgba(255,255,255,0.1);
    }

    .map-sidebar-footer {
        display: none; /* logout button moved inline elsewhere on mobile */
    }

    .map-portal-main {
        overflow-y: visible;
    }

    .map-workspace-header {
        padding: 16px 16px;
    }

    .map-workspace-header h2 {
        font-size: 1.2rem;
    }

    #map-workspace-content {
        padding: 16px;
    }

    .map-stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .map-agent-overview-cards,
    .map-dashboard-competition-grid,
    .map-case-confirm-details {
        grid-template-columns: 1fr;
    }

    .map-dashboard-section-head,
    .map-case-confirm-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .map-dashboard-section-head .map-btn-small,
    .map-case-confirm-actions .map-btn-small {
        width: 100%;
    }

    .map-registration-grid {
        grid-template-columns: 1fr !important;
    }

    .map-supporting-doc-guide-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .map-profile-photo-editor {
        align-items: flex-start;
        flex-direction: column;
    }

    .map-comp-card,
    .map-comp-card-compact {
        grid-template-columns: 1fr;
    }

    .map-comp-card-image {
        max-width: 260px;
        width: 100%;
    }

    .map-rule-detail {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .map-solicitor-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .map-party-row {
        grid-template-columns: 1fr;
    }

    .map-portal-table {
        font-size: 12px;
    }

    .map-agent-submissions-table {
        table-layout: auto;
        min-width: 760px;
    }

    .map-doc-upload-form {
        grid-template-columns: 1fr;
    }

    .map-doc-upload-btn {
        width: 100%;
    }

    .map-case-view-panel {
        padding: 16px;
    }

    .map-case-detail-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .map-case-file-queue-row {
        grid-template-columns: 1fr auto;
    }

    .map-case-file-queue-size {
        grid-column: 1;
    }

    .map-ctos-link-row,
    .map-ctos-report-form {
        grid-template-columns: 1fr;
    }

    .map-portal-wrapper .map-ctos-request-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }

    .map-portal-wrapper .map-ctos-request-status,
    .map-portal-wrapper .map-ctos-request-actions {
        min-width: 0;
        justify-items: stretch;
    }

    .map-portal-wrapper .map-status-pill {
        justify-self: start;
        max-width: 100%;
        white-space: normal;
    }

    .map-portal-wrapper .map-ctos-request-actions {
        justify-items: stretch;
    }

    .map-ctos-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .map-portal-table th,
    .map-portal-table td {
        padding: 8px 10px;
    }
}

.map-reward-balance-pill {
    background: #eef6ff;
    border: 1px solid var(--portal-border, #d8e2ee);
    border-radius: 999px;
    color: var(--portal-primary, #1e3a5f);
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 12px;
    white-space: nowrap;
}
.map-reward-inline-notice {
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
    margin: 0 0 16px;
    padding: 12px 14px;
}
.map-reward-inline-notice-success {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
}
.map-reward-inline-notice-error {
    background: #fff2f0;
    border: 1px solid #f3b8b0;
    color: #b42318;
}
.map-reward-card-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.map-reward-card {
    background: #fff;
    border: 1px solid var(--portal-border, #d8e2ee);
    border-radius: 8px;
    display: grid;
    grid-template-columns: minmax(150px, 44%) minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
}
.map-reward-card-media {
    align-items: center;
    background: #f4f7fb;
    color: var(--portal-soft-text, #6f7f86);
    display: flex;
    font-size: 12px;
    font-weight: 800;
    justify-content: center;
    min-height: 220px;
    position: relative;
    text-transform: uppercase;
}
.map-reward-card-media img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}
.map-reward-points-badge {
    background: #fff3cd;
    border-radius: 999px;
    color: #e65100;
    font-size: 11px;
    font-weight: 900;
    left: 12px;
    line-height: 1;
    padding: 7px 10px;
    position: absolute;
    text-transform: none;
    top: 12px;
    z-index: 2;
}
.map-reward-card-body {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
    padding: 18px;
}
.map-reward-card-body h5 {
    color: var(--portal-text, #1e3a5f);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
    text-transform: uppercase;
}
.map-reward-card p {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 12px;
    line-height: 1.45;
    margin: 0;
}
.map-reward-package {
    color: var(--portal-soft-text, #6f7f86) !important;
    font-size: 12px !important;
    font-weight: 700;
    letter-spacing: .01em;
}
.map-reward-package p,
.map-reward-package ul,
.map-reward-package ol {
    color: inherit;
    font-size: inherit;
    line-height: 1.45;
    margin: 0 0 6px;
}
.map-reward-package p:last-child,
.map-reward-package ul:last-child,
.map-reward-package ol:last-child {
    margin-bottom: 0;
}
.map-reward-details {
    border-top: 1px solid #edf2f7;
    padding-top: 8px;
}
.map-reward-details summary {
    align-items: center;
    color: var(--portal-primary, #1e3a5f);
    cursor: pointer;
    display: flex;
    font-size: 13px;
    font-weight: 800;
    gap: 6px;
    list-style: none;
}
.map-reward-details summary::-webkit-details-marker {
    display: none;
}
.map-reward-details summary::before {
    content: "▸";
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    width: 10px;
}
.map-reward-details[open] summary::before {
    transform: rotate(90deg);
}
.map-reward-details > div {
    padding-top: 6px;
    padding-left: 16px;
}
.map-reward-card-meta {
    color: var(--portal-soft-text, #6f7f86);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 8px 14px;
    margin: 2px 0 4px;
}
.map-reward-card-action {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: auto;
}
.map-reward-card-action .map-btn-small[disabled] {
    cursor: not-allowed;
    opacity: .55;
}
.map-reward-global-terms {
    background: #fff;
    border: 1px solid var(--portal-border, #d8e2ee);
    border-radius: 8px;
    margin: 0 0 18px;
    padding: 14px 16px;
}
.map-reward-global-terms summary {
    color: var(--portal-primary, #1e3a5f);
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
}
.map-reward-global-terms-body {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 13px;
    line-height: 1.6;
    padding-top: 12px;
}
.map-reward-global-terms-body p:last-child {
    margin-bottom: 0;
}
.map-reward-confirm-modal {
    align-items: center;
    background: rgba(10, 24, 42, .52);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 18px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 99999;
}
.map-reward-confirm-dialog {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 22px 60px rgba(15, 31, 54, .22);
    max-width: 440px;
    padding: 22px;
    width: min(100%, 440px);
}
.map-reward-confirm-dialog h4 {
    color: var(--portal-primary, #1e3a5f);
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 10px;
}
.map-reward-confirm-dialog p {
    color: var(--portal-soft-text, #6f7f86);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 12px;
}
.map-reward-confirm-dialog textarea {
    min-height: 78px;
    width: 100%;
}
.map-reward-confirm-error {
    background: #fff2f0;
    border: 1px solid #f3b8b0;
    border-radius: 6px;
    color: #b42318 !important;
    font-weight: 700;
    padding: 10px 12px;
}
.map-reward-confirm-check {
    align-items: flex-start;
    color: var(--portal-text, #1e3a5f);
    display: flex;
    font-size: 13px;
    font-weight: 700;
    gap: 9px;
    line-height: 1.4;
    margin: 12px 0;
}
.map-reward-confirm-check input {
    flex: 0 0 auto;
    margin-top: 2px;
}
.map-reward-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}
.map-reward-page-link {
    background: #fff;
    border: 1px solid var(--portal-border, #d8e2ee);
    border-radius: 6px;
    color: var(--portal-primary, #1e3a5f);
    cursor: pointer;
    font-weight: 800;
    min-width: 38px;
    padding: 8px 12px;
}
.map-reward-page-link.active {
    background: var(--portal-primary, #1e3a5f);
    color: #fff;
}
.map-point-cycle-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.map-point-cycle-pill {
    background: #fff;
    border: 1px solid var(--portal-border, #d8e2ee);
    border-radius: 8px;
    padding: 14px;
}
.map-point-cycle-pill strong {
    color: var(--portal-primary, #1e3a5f);
    display: block;
    font-size: 20px;
    font-weight: 800;
}
.map-point-cycle-pill span,
.map-point-cycle-pill small {
    color: var(--portal-soft-text, #6f7f86);
    display: block;
    font-size: 12px;
    margin-top: 3px;
}

@media (max-width: 900px) {
    .map-reward-card-grid {
        grid-template-columns: 1fr;
    }
    .map-point-cycle-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .map-reward-card {
        grid-template-columns: 1fr;
    }
    .map-reward-card-media {
        min-height: 180px;
    }
}
