/* ============================================================
   Compliance Check Requests — style.css  v2.1
   ============================================================ */

/* ── Tokens ──────────────────────────────────────────────── */
:root {
    --ccr-bg: #f8f9fb;
    --ccr-surface: #ffffff;
    --ccr-border: #e3e7ef;
    --ccr-border-focus: #4f6ef7;
    --ccr-text: #1a202c;
    --ccr-muted: #6b7280;
    --ccr-primary: #4f6ef7;
    --ccr-primary-h: #3a58e0;
    --ccr-danger: #ef4444;
    --ccr-success-bg: #ecfdf5;
    --ccr-success-text: #065f46;
    --ccr-error-bg: #fef2f2;
    --ccr-error-text: #991b1b;
    --ccr-radius: 10px;
    --ccr-shadow: 0 2px 16px rgba(0, 0, 0, .07);
    --ccr-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Wrapper ─────────────────────────────────────────────── */

.ccr-wrap {
    font-family: var(--ccr-font);
    color: var(--ccr-text);
    width: 100%;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

/* ── Card ────────────────────────────────────────────────── */
.ccr-card {
    background: var(--ccr-surface);
    border: 1px solid var(--ccr-border);
    border-radius: var(--ccr-radius);
    box-shadow: var(--ccr-shadow);
    overflow: hidden;
}

.ccr-card__header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--ccr-border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ccr-card__back {
    flex: 0 0 100%;
}

.ccr-back-link {
    font-size: .85rem;
    color: var(--ccr-primary);
    text-decoration: none;
    font-weight: 500;
}

.ccr-back-link:hover {
    text-decoration: underline;
}

.ccr-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.ccr-card__meta {
    font-size: .85rem;
    color: var(--ccr-muted);
    margin: 0;
    flex: 0 0 100%;
}

/* ── Divider ─────────────────────────────────────────────── */
.ccr-divider {
    border-top: 2px solid #d4dcff;
    margin: 0;
}

/* ── Review summary (approver name + message) ────────────── */
.ccr-review-summary {
    padding: 20px 28px;
    background: #f0f4ff;
    border-bottom: 1px solid #d4dcff;
}

.ccr-review-summary__reviewer {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.ccr-review-summary__label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ccr-primary);
}

.ccr-review-summary__name {
    font-size: .95rem;
    font-weight: 600;
    color: var(--ccr-text);
}

.ccr-review-summary__message {
    font-size: .9rem;
    color: #374151;
    line-height: 1.6;
    margin-top: 4px;
    padding: 10px 14px;
    background: var(--ccr-surface);
    border: 1px solid #d4dcff;
    border-radius: 7px;
}

/* ── Submission meta (subscriber name + date) ────────────── */
.ccr-submission-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--ccr-border);
    background: var(--ccr-bg);
}

.ccr-submission-meta__name {
    font-size: .9rem;
    font-weight: 600;
    color: var(--ccr-text);
}

.ccr-submission-meta__date {
    font-size: .82rem;
    color: var(--ccr-muted);
}

/* ── Form layout ─────────────────────────────────────────── */
.ccr-form {
    padding: 24px 28px;
}

.ccr-grid {
    display: grid;
    gap: 20px;
}

.ccr-grid--2 {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 600px) {
    .ccr-grid--2 {
        grid-template-columns: 1fr;
    }
}

.ccr-submission-detail {
    padding: 24px 28px;
}

.ccr-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ccr-field--full {
    grid-column: 1 / -1;
}

.ccr-label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--ccr-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.ccr-required {
    color: var(--ccr-danger);
}

/* ── Inputs ──────────────────────────────────────────────── */
.ccr-textarea,
.ccr-select {
    font-family: var(--ccr-font);
    font-size: .92rem;
    color: var(--ccr-text);
    background: var(--ccr-bg);
    border: 1px solid var(--ccr-border);
    border-radius: 7px;
    padding: 10px 12px;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    width: 100%;
    box-sizing: border-box;
}

.ccr-textarea {
    resize: vertical;
    min-height: 120px;
}

.ccr-textarea--full {
    min-height: 160px;
}

.ccr-textarea--feedback {
    background: #fffbeb;
    border-color: #fbbf24;
}

.ccr-textarea:focus,
.ccr-select:focus {
    border-color: var(--ccr-border-focus);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, .15);
}

.ccr-textarea[readonly],
.ccr-select:disabled {
    opacity: .75;
    cursor: default;
}

/* ── Radio buttons ───────────────────────────────────────── */
.ccr-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.ccr-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 2px solid var(--ccr-border);
    border-radius: 7px;
    cursor: pointer;
    font-size: .88rem;
    font-weight: 600;
    background: var(--ccr-bg);
    transition: border-color .15s, background .15s, color .15s;
    user-select: none;
}

.ccr-radio-label input[type="radio"] {
    display: none;
}

/* Custom radio dot */
.ccr-radio-custom {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--ccr-border);
    flex-shrink: 0;
    transition: border-color .15s, background .15s;
    position: relative;
}

.ccr-radio-custom::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: transparent;
    transition: background .15s;
}

/* Selected state — generic */
.ccr-radio-label:has(input:checked) .ccr-radio-custom {
    border-color: var(--ccr-primary);
}

.ccr-radio-label:has(input:checked) .ccr-radio-custom::after {
    background: var(--ccr-primary);
}

/* Per-status colour tints when selected */
.ccr-radio-label--pending:has(input:checked) {
    border-color: #ca8a04;
    background: #fef9c3;
    color: #854d0e;
}

.ccr-radio-label--pending:has(input:checked) .ccr-radio-custom {
    border-color: #ca8a04;
}

.ccr-radio-label--pending:has(input:checked) .ccr-radio-custom::after {
    background: #ca8a04;
}

.ccr-radio-label--approved:has(input:checked) {
    border-color: #16a34a;
    background: #dcfce7;
    color: #166534;
}

.ccr-radio-label--approved:has(input:checked) .ccr-radio-custom {
    border-color: #16a34a;
}

.ccr-radio-label--approved:has(input:checked) .ccr-radio-custom::after {
    background: #16a34a;
}

.ccr-radio-label--rejected:has(input:checked) {
    border-color: #dc2626;
    background: #fee2e2;
    color: #991b1b;
}

.ccr-radio-label--rejected:has(input:checked) .ccr-radio-custom {
    border-color: #dc2626;
}

.ccr-radio-label--rejected:has(input:checked) .ccr-radio-custom::after {
    background: #dc2626;
}

.ccr-radio-label--approved-with-feedback:has(input:checked) {
    border-color: #2563eb;
    background: #dbeafe;
    color: #1e40af;
}

.ccr-radio-label--approved-with-feedback:has(input:checked) .ccr-radio-custom {
    border-color: #2563eb;
}

.ccr-radio-label--approved-with-feedback:has(input:checked) .ccr-radio-custom::after {
    background: #2563eb;
}

.ccr-radio-label:hover {
    border-color: var(--ccr-primary);
    background: #eef1ff;
}

/* ── Dropzone ────────────────────────────────────────────── */
.ccr-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--ccr-border);
    border-radius: var(--ccr-radius);
    padding: 32px 16px;
    cursor: pointer;
    background: var(--ccr-bg);
    transition: border-color .18s, background .18s;
    text-align: center;
    gap: 6px;
}

.ccr-dropzone:hover,
.ccr-dropzone--over {
    border-color: var(--ccr-primary);
    background: #eef1ff;
}

.ccr-dropzone__icon {
    font-size: 2rem;
}

.ccr-dropzone__text {
    font-weight: 600;
    margin: 0;
    font-size: .9rem;
}

.ccr-dropzone__hint {
    font-size: .78rem;
    color: var(--ccr-muted);
    margin: 0;
}

/* ── Image frame ─────────────────────────────────────────── */
.ccr-img-frame {
    border-radius: var(--ccr-radius);
    overflow: hidden;
    border: 1px solid var(--ccr-border);
    background: var(--ccr-bg);
    position: relative;
}

.ccr-img-frame img {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: contain;
}

.ccr-img-clear {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.ccr-img-clear:hover {
    background: rgba(0, 0, 0, .8);
}

/* ── File label ──────────────────────────────────────────── */
.ccr-file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--ccr-border);
    border-radius: 7px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: .88rem;
    background: var(--ccr-bg);
}

.ccr-file-btn {
    background: var(--ccr-primary);
    color: #fff;
    border-radius: 5px;
    padding: 4px 12px;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Buttons ─────────────────────────────────────────────── */
.ccr-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--ccr-font);
    font-size: .88rem;
    font-weight: 600;
    border: none;
    border-radius: 7px;
    padding: 9px 20px;
    cursor: pointer;
    text-decoration: none;
    transition: background .18s, box-shadow .18s, transform .1s;
    color: #ffff;
}

.ccr-btn:active {
    transform: scale(.97);
}

.ccr-btn--primary {
    background: var(--ccr-primary);
    color: #fff;
}

.ccr-btn--primary:hover {
    background: var(--ccr-primary-h);
    color: #fff;
}

.ccr-btn--secondary {
    background: #eef1ff;
    color: var(--ccr-primary);
}

.ccr-btn--secondary:hover {
    background: #d9defc;
}

.ccr-btn--ghost {
    background: #22B24D;
    color: #ffff;
    border: 1px solid #22B24D;
}

.ccr-btn--ghost:hover {
    background: var(--ccr-bg);
    color: #22B24D;
}

.ccr-btn--lg {
    padding: 11px 28px;
    font-size: .95rem;
}

/* ── Actions row ─────────────────────────────────────────── */
.ccr-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.ccr-actions--right {
    justify-content: flex-end;
}

/* ── Badges ──────────────────────────────────────────────── */
.ccr-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.ccr-badge--pending {
    background: #fef9c3;
    color: #854d0e;
}

.ccr-badge--approved {
    background: #dcfce7;
    color: #166534;
}

.ccr-badge--rejected {
    background: #fee2e2;
    color: #991b1b;
}

.ccr-badge--approved-with-feedback {
    background: #dbeafe;
    color: #1e40af;
}

/* ── Message banners ─────────────────────────────────────── */
.ccr-msg {
    padding: 14px 18px;
    border-radius: var(--ccr-radius);
    font-size: .9rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ccr-msg--success {
    background: var(--ccr-success-bg);
    color: var(--ccr-success-text);
}

.ccr-msg--error {
    background: var(--ccr-error-bg);
    color: var(--ccr-error-text);
}

/* ── History list ────────────────────────────────────────── */
.ccr-history-list {
    display: flex;
    flex-direction: column;
}

.ccr-history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--ccr-border);
    text-decoration: none;
    color: var(--ccr-text);
    transition: background .15s;
}

.ccr-history-item:last-child {
    border-bottom: none;
}

.ccr-history-item:hover {
    background: var(--ccr-bg);
}

.ccr-history-item__img {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--ccr-border);
    background: var(--ccr-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ccr-history-item__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ccr-history-item__no-img {
    font-size: 1.5rem;
}

.ccr-history-item__body {
    flex: 1;
    min-width: 0;
}

.ccr-history-item__title {
    font-weight: 600;
    font-size: .92rem;
    margin-bottom: 3px;
}

.ccr-history-item__desc {
    font-size: .83rem;
    color: var(--ccr-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ccr-history-item__meta {
    font-size: .78rem;
    color: var(--ccr-muted);
    margin-top: 4px;
}

.ccr-history-item__status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ccr-history-item__arrow {
    color: var(--ccr-muted);
    font-size: 1rem;
}

/* ── "Approved with Feedback" panel ──────────────────────── */
.ccr-awm-panel {
    padding: 28px;
    border-bottom: 1px solid var(--ccr-border);
    text-align: center;
}

.ccr-awm-icon {
    font-size: 2.5rem;
}

.ccr-awm-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 8px 0 6px;
}

.ccr-awm-body {
    color: var(--ccr-muted);
    font-size: .9rem;
    margin: 0 0 24px;
}

.ccr-awm-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    text-align: left;
}

@media (max-width: 580px) {
    .ccr-awm-options {
        grid-template-columns: 1fr;
    }
}

.ccr-awm-option {
    border: 1px solid var(--ccr-border);
    border-radius: var(--ccr-radius);
    padding: 18px;
    background: var(--ccr-bg);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ccr-awm-option__header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.ccr-awm-option__icon {
    font-size: 1.3rem;
}

.ccr-awm-option p {
    font-size: .875rem;
    color: var(--ccr-muted);
    margin: 0;
}

/* ── Already-submitted notice ───────────────────────────── */
.ccr-already-submitted {
    text-align: center;
    padding: 32px 18px;
    color: var(--ccr-muted);
    font-size: .88rem;
    font-weight: 500;
}

/* ── Admin dashboard ─────────────────────────────────────── */
.ccr-admin-wrap {
    padding-top: 20px;
}

.ccr-admin-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ccr-admin-table th {
    font-weight: 700;
}

.ccr-admin-table td {
    vertical-align: middle;
}

/* ── Claim banner styles (add to style.css if preferred) ── */
.ccr-claim-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.ccr-claim-banner--unclaimed {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    align-items: center;
}

.ccr-claim-banner--mine {
    background: #f0fdf4;
    border: 1px solid #86efac;
}

.ccr-claim-banner--other {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
}

.ccr-claim-banner__info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ccr-claim-banner__icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.ccr-btn--claim {
    background: #f59e0b;
    border: none;
    color: #fff;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    font-size: 14px;
    transition: background .2s;
}

.ccr-btn--claim:hover {
    background: #d97706;
}