/* --- SCOPED CSS FOR FINAL REPORT CSR VIEW PAGE --- */
.frcsr-wrapper {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    margin-bottom: 32px;
}

.frcsr-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 18px 0;
}

/* ── KPI Cards ── */
.frcsr-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.frcsr-kpi-card {
    background-color: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-top: 4px solid transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    min-width: 0;
}

.frcsr-kpi-blue {
    border-top-color: #3B82F6;
    background: linear-gradient(180deg, #F2F7FF 0%, #FFFFFF 60%);
}

.frcsr-kpi-green {
    border-top-color: #22C55E;
    background: linear-gradient(180deg, #F2FFFA 0%, #FFFFFF 60%);
}

.frcsr-kpi-orange {
    border-top-color: #F59E0B;
    background: linear-gradient(180deg, #FFFAF1 0%, #FFFFFF 60%);
}

.frcsr-kpi-red {
    border-top-color: #EF4444;
    background: linear-gradient(180deg, #FFEFEF 0%, #FFFFFF 60%);
}

.frcsr-kpi-gray {
    border-top-color: #D1D5DB;
    background: linear-gradient(180deg, #EEEEF3 0%, #FFFFFF 60%);
}

.frcsr-kpi-body {
    padding: 16px 18px 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex: 1;
}

.frcsr-kpi-number {
    font-size: 26px;
    font-weight: 700;
    color: #1F2937;
    line-height: 1;
    margin-bottom: 6px;
}

.frcsr-kpi-label {
    font-size: 12px;
    color: #6B7280;
    font-weight: 500;
    margin: 0;
}

.frcsr-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid transparent;
}

.frcsr-icon-blue {
    background: #EFF6FF;
    color: #3B82F6;
    border-color: #DBEAFE;
}

.frcsr-icon-green {
    background: #F0FDF4;
    color: #22C55E;
    border-color: #DCFCE7;
}

.frcsr-icon-orange {
    background: #FFFBEB;
    color: #F59E0B;
    border-color: #FEF3C7;
}

.frcsr-icon-red {
    background: #FEF2F2;
    color: #EF4444;
    border-color: #FEE2E2;
}

.frcsr-icon-gray {
    background: #F9FAFB;
    color: #6B7280;
    border-color: #F3F4F6;
}

.frcsr-kpi-footer {
    border-top: 1px solid #F3F4F6;
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.15s;
}

    .frcsr-kpi-footer:hover {
        color: #4B5563;
    }

/* ── Generic Card ── */
.frcsr-card {
    background-color: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* ── Filters ── */
/* ── Filters Header (with light background bar) ── */
.frcsr-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    background-color: #F5F8F6;
    padding: 14px 20px;
    margin: -18px -20px 18px -20px; 
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom: 1px solid #E5E7EB;
}

    .frcsr-filters-header > span {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        color: #1F2937;
    }

        .frcsr-filters-header > span i {
            font-size: 16px;
            color: #6B7280;
        }

.frcsr-toggle-icon {
    color: #6B7280;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s;
}

.frcsr-filters-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.frcsr-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

    .frcsr-form-group > label {
        font-size: 12px;
        font-weight: 600;
        color: #374151;
    }

.frcsr-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

/* ── Form Controls ── */
.frcsr-control {
    appearance: none;
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: #374151;
    font-family: inherit;
    outline: none;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .frcsr-control::placeholder {
        color: #9CA3AF;
    }

    .frcsr-control:focus {
        border-color: #3B82F6;
        background-color: #FFFFFF;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

.frcsr-input-with-icon {
    position: relative;
}

    .frcsr-input-with-icon .frcsr-control {
        padding-right: 32px;
    }

.frcsr-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    pointer-events: none;
    font-size: 14px;
}

.frcsr-select {
    padding-right: 32px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* ── Buttons ── */
.frcsr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.frcsr-btn-ghost {
    background-color: #FFFFFF;
    border-color: #E5E7EB;
    color: #4B5563;
}

    .frcsr-btn-ghost:hover {
        background-color: #F9FAFB;
    }

.frcsr-btn-outline {
    background-color: #FFFFFF;
    border-color: #E5E7EB;
    color: #4B5563;
}

    .frcsr-btn-outline:hover {
        background-color: #F9FAFB;
        color: #1F2937;
    }

.frcsr-btn-primary {
    background-color: #2563EB;
    color: #FFFFFF;
    border-color: #2563EB;
}

    .frcsr-btn-primary:hover {
        background-color: #1D4ED8;
        border-color: #1D4ED8;
    }

/* ── Table Head ── */
.frcsr-table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 14px;
}

.frcsr-table-head-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.frcsr-table-title {
    font-size: 15px;
    font-weight: 700;
    color: #1F2937;
    margin: 0;
}

.frcsr-search {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 220px;
}

    .frcsr-search i {
        position: absolute;
        left: 12px;
        color: #9CA3AF;
        font-size: 13px;
    }

    .frcsr-search input {
        width: 100%;
        background-color: #F9FAFB;
        border: 1px solid #E5E7EB;
        border-radius: 6px;
        padding: 8px 12px 8px 32px;
        font-size: 12px;
        color: #374151;
        outline: none;
    }

        .frcsr-search input::placeholder {
            color: #9CA3AF;
        }

        .frcsr-search input:focus {
            border-color: #3B82F6;
            background-color: #FFFFFF;
        }

.frcsr-table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Table ── */
.frcsr-table-wrap {
    max-height: 450px;
    overflow: auto;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    margin-bottom: 14px;
    -webkit-overflow-scrolling: touch;
}

    .frcsr-table-wrap::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    .frcsr-table-wrap::-webkit-scrollbar-track {
        background: #F1F5F9;
    }

    .frcsr-table-wrap::-webkit-scrollbar-thumb {
        background: #CBD5E1;
        border-radius: 4px;
    }

        .frcsr-table-wrap::-webkit-scrollbar-thumb:hover {
            background: #94A3B8;
        }

.frcsr-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1500px;
    background-color: #FFFFFF;
}

    .frcsr-table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background-color: #F9FAFB;
        color: #6B7280;
        font-size: 11px;
        font-weight: 600;
        padding: 12px 12px;
        border-bottom: 1px solid #E5E7EB;
        text-align: center;
        white-space: nowrap;
    }

        .frcsr-table thead th:nth-child(2),
        .frcsr-table thead th:nth-child(3) {
            text-align: left;
        }

    .frcsr-table tbody td {
        font-size: 12px;
        color: #1F2937;
        padding: 14px 12px;
        vertical-align: middle;
        border-bottom: 1px solid #F3F4F6;
        text-align: center;
        white-space: nowrap;
    }

        .frcsr-table tbody td:nth-child(2),
        .frcsr-table tbody td:nth-child(3),
        .frcsr-table tbody td.frcsr-cell-left {
            text-align: left;
        }

    .frcsr-table tbody tr:last-child td {
        border-bottom: none;
    }

    .frcsr-table tbody tr:hover {
        background-color: #FAFAFA;
    }

    .frcsr-table input[type="checkbox"] {
        width: 14px;
        height: 14px;
        accent-color: #2563EB;
        cursor: pointer;
    }

.frcsr-th-check, .frcsr-th-action {
    width: 60px;
}

/* ── Pills ── */
.frcsr-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.frcsr-pill-green {
    background-color: #DCFCE7;
    color: #15803D;
}

.frcsr-pill-amber {
    background-color: #FEF3C7;
    color: #B45309;
}

.frcsr-pill-red {
    background-color: #FEE2E2;
    color: #B91C1C;
}

.frcsr-pill-blue {
    background-color: #DBEAFE;
    color: #1D4ED8;
}

.frcsr-pill-gray {
    background-color: #F3F4F6;
    color: #4B5563;
}

/* ── Row actions ── */
.frcsr-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.frcsr-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: opacity 0.15s;
}

    .frcsr-icon-btn:hover {
        opacity: 0.7;
    }

.frcsr-action-view {
    color: #3B82F6;
}

.frcsr-action-delete {
    color: #EF4444;
}

/* ── Rejection Banner ── */
.frcsr-rejection-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 14px;
}

.frcsr-rejection-icon {
    color: #DC2626;
    font-size: 18px;
    flex-shrink: 0;
}

.frcsr-rejection-banner strong {
    color: #B91C1C;
    font-weight: 700;
    font-size: 13px;
    margin-right: 4px;
}

.frcsr-rejection-banner span {
    color: #991B1B;
    font-size: 13px;
}

/* ── Pagination ── */
.frcsr-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.frcsr-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6B7280;
}

.frcsr-page-select {
    width: 70px;
    padding: 6px 26px 6px 10px;
    font-size: 12px;
}

.frcsr-page-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.frcsr-page-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    background-color: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 12px;
    color: #4B5563;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

    .frcsr-page-btn:hover {
        background-color: #F9FAFB;
    }

.frcsr-page-active {
    border-color: #2563EB;
    color: #2563EB;
    font-weight: 700;
}

.frcsr-page-ellipsis {
    color: #9CA3AF;
    padding: 0 4px;
}

/* ── Drawer (Side Panel) ── */
.frcsr-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

.frcsr-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 460px;
    max-width: 100vw;
    background-color: #F8FAFC;
    z-index: 1050;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    animation: frcsrSlideIn 0.3s ease-out;
}

@keyframes frcsrSlideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.frcsr-drawer-head {
    padding: 18px 24px;
    background-color: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

    .frcsr-drawer-head h2 {
        font-size: 17px;
        font-weight: 700;
        color: #1F2937;
        margin: 0 0 4px 0;
    }

    .frcsr-drawer-head p {
        font-size: 13px;
        color: #6B7280;
        margin: 0;
    }

.frcsr-drawer-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9CA3AF;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

    .frcsr-drawer-close:hover {
        color: #4B5563;
    }

.frcsr-drawer-body {
    padding: 18px 24px;
    overflow-y: auto;
    flex: 1;
}

    .frcsr-drawer-body::-webkit-scrollbar {
        width: 6px;
    }

    .frcsr-drawer-body::-webkit-scrollbar-thumb {
        background: #CBD5E1;
        border-radius: 4px;
    }

.frcsr-drawer-section {
    margin-bottom: 22px;
}

.frcsr-drawer-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #16A34A;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #E5E7EB;
}

.frcsr-drawer-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 5px 0;
    font-size: 13px;
}

    .frcsr-drawer-row > span:first-child {
        color: #6B7280;
    }

    .frcsr-drawer-row > span:last-child {
        color: #1F2937;
        font-weight: 600;
        text-align: right;
    }

.frcsr-drawer-total {
    border-top: 1px dashed #E5E7EB;
    margin-top: 6px;
    padding-top: 8px;
}

    .frcsr-drawer-total strong:first-child {
        color: #1F2937;
    }

    .frcsr-drawer-total strong:last-child {
        color: #16A34A;
        font-size: 14px;
    }

.frcsr-drawer-tags {
    margin-bottom: 10px;
}

.frcsr-drawer-taglabel {
    display: block;
    color: #6B7280;
    font-size: 12px;
    margin-bottom: 6px;
}

.frcsr-drawer-tags .frcsr-pill {
    margin: 2px 4px 2px 0;
}

/* Timeline */
.frcsr-timeline {
    position: relative;
    padding-left: 24px;
}

    .frcsr-timeline::before {
        content: '';
        position: absolute;
        left: 9px;
        top: 6px;
        bottom: 10px;
        width: 2px;
        background-color: #22C55E;
    }

.frcsr-timeline-item {
    position: relative;
    margin-bottom: 14px;
}

    .frcsr-timeline-item:last-child {
        margin-bottom: 0;
    }

.frcsr-timeline-dot {
    position: absolute;
    left: -24px;
    top: 0;
    width: 20px;
    height: 20px;
    background-color: #22C55E;
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.frcsr-timeline-title {
    font-size: 13px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 2px;
}

.frcsr-timeline-desc {
    font-size: 12px;
    color: #6B7280;
    display: flex;
    align-items: center;
}

.frcsr-chip-dark {
    background-color: #374151;
    color: #FFFFFF;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 6px;
}

.frcsr-drawer-foot {
    padding: 14px 24px;
    background-color: #FFFFFF;
    border-top: 1px solid #E5E7EB;
    display: flex;
    gap: 8px;
}

.frcsr-drawer-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 0;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #FFFFFF;
    cursor: pointer;
    transition: background-color 0.15s;
}

.frcsr-drawer-btn-dark {
    background-color: #374151;
}

    .frcsr-drawer-btn-dark:hover {
        background-color: #1F2937;
    }

.frcsr-drawer-btn-green {
    background-color: #166534;
}

    .frcsr-drawer-btn-green:hover {
        background-color: #14532D;
    }

.frcsr-drawer-btn-blue {
    background-color: #2563EB;
}

    .frcsr-drawer-btn-blue:hover {
        background-color: #1D4ED8;
    }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1280px) {
    .frcsr-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .frcsr-filters-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .frcsr-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .frcsr-filters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .frcsr-table-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .frcsr-search {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .frcsr-title {
        font-size: 17px;
    }

    .frcsr-card {
        padding: 14px;
    }

    .frcsr-filters-grid {
        grid-template-columns: 1fr;
    }

    .frcsr-filter-actions {
        flex-direction: column-reverse;
    }

        .frcsr-filter-actions .frcsr-btn {
            width: 100%;
        }

    .frcsr-table-head-left {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }

    .frcsr-search {
        width: 100%;
    }

    .frcsr-table-actions .frcsr-btn {
        flex: 1;
        min-width: 110px;
    }

    .frcsr-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .frcsr-page-controls {
        justify-content: center;
        flex-wrap: wrap;
    }

    .frcsr-drawer {
        width: 100vw;
    }
}

@media (max-width: 480px) {
    .frcsr-kpi-grid {
        grid-template-columns: 1fr;
    }

    .frcsr-kpi-number {
        font-size: 22px;
    }

    .frcsr-rejection-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .frcsr-drawer-foot {
        flex-direction: column;
    }
}
