/* ──────────────────────────────────────────
   SCOPED CSS FOR RMD DASHBOARD — RESPONSIVE
   Breakpoints: 1440 / 1280 / 1024 / 768 / 640 / 480 / 380
   ────────────────────────────────────────── */

.rmd-wrapper {
    font-family: 'Inter', sans-serif;
    margin-bottom: 32px;
    min-width: 0;
}

/* ── Welcome Section ── */
.rmd-welcome {
    margin-bottom: 22px;
}

    .rmd-welcome h1 {
        font-size: 22px;
        font-weight: 700;
        color: #111827;
        margin: 0 0 6px 0;
        line-height: 1.3;
    }

.rmd-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: #6b7280;
    font-size: 13px;
}

.rmd-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .rmd-meta-item svg {
        color: #9ca3af;
        flex-shrink: 0;
    }

.rmd-meta-sep {
    color: #d1d5db;
}

/* ── Section Header ── */
.rmd-section-header {
    margin-bottom: 14px;
}

    .rmd-section-header h2 {
        font-size: 16px;
        font-weight: 700;
        color: #111827;
        margin: 0 0 4px 0;
    }

    .rmd-section-header p {
        font-size: 12px;
        color: #6b7280;
        margin: 0;
    }

/* ── Budget Cards ── */
.rmd-budget-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.rmd-budget-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-left: 4px solid transparent;
    min-width: 0;
}

.rmd-accent-green {
    border-left-color: #22C55E;
}

.rmd-accent-blue {
    border-left-color: #3B82F6;
}

.rmd-accent-orange {
    border-left-color: #F97316;
}

.rmd-accent-gray {
    border-left-color: #9CA3AF;
}

.rmd-budget-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.rmd-budget-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    line-height: 1.3;
}

.rmd-budget-amount {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    word-break: break-word;
}

.rmd-budget-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rmd-icon-green {
    background-color: #DCFCE7;
    color: #16A34A;
}

.rmd-icon-blue {
    background-color: #DBEAFE;
    color: #2563EB;
}

.rmd-icon-orange {
    background-color: #FFEDD5;
    color: #EA580C;
}

.rmd-icon-gray {
    background-color: #F3F4F6;
    color: #6B7280;
}

.rmd-budget-mid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rmd-budget-sub {
    font-size: 12px;
    color: #6b7280;
}

/* ── Tags ── */
.rmd-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.rmd-tag-green {
    background-color: #DCFCE7;
    color: #15803D;
}

.rmd-tag-blue {
    background-color: #DBEAFE;
    color: #1D4ED8;
}

.rmd-tag-orange {
    background-color: #FFEDD5;
    color: #C2410C;
}

.rmd-tag-gray {
    background-color: #F3F4F6;
    color: #4B5563;
}

/* ── Progress Bar ── */
.rmd-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rmd-progress-track {
    flex: 1;
    min-width: 0;
    height: 6px;
    background-color: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.rmd-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.rmd-fill-green {
    background-color: #22C55E;
}

.rmd-fill-blue {
    background-color: #3B82F6;
}

.rmd-fill-orange {
    background-color: #F97316;
}

.rmd-fill-gray {
    background-color: #9CA3AF;
}

.rmd-progress-text {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    min-width: 32px;
    text-align: right;
    flex-shrink: 0;
}

/* ── Alert Banner ── */
.rmd-alert {
    background-color: #FFFBEB;
    border: 1px solid #FDE68A;
    border-left: 4px solid #F59E0B;
    border-radius: 10px;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.rmd-alert-content {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.rmd-alert-icon {
    width: 40px;
    height: 40px;
    background-color: #FEF3C7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D97706;
    flex-shrink: 0;
}

.rmd-alert-text {
    min-width: 0;
}

.rmd-alert-title {
    font-size: 14px;
    font-weight: 700;
    color: #B45309;
    margin-bottom: 2px;
}

.rmd-alert-desc {
    font-size: 12px;
    color: #92400E;
    line-height: 1.5;
}

.rmd-alert-btn {
    background-color: #2563EB;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

    .rmd-alert-btn:hover {
        background-color: #1D4ED8;
    }

/* ── CSR Workflow Summary ── */
.rmd-csr-section {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 22px;
}

.rmd-csr-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px 0;
}

.rmd-csr-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.rmd-csr-card {
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 96px;
    min-width: 0;
}

.rmd-csr-green {
    background-color: #DCFCE7;
}

.rmd-csr-blue {
    background-color: #DBEAFE;
}

.rmd-csr-peach {
    background-color: #FFEDD5;
}

.rmd-csr-pink {
    background-color: #FCE7F3;
}

.rmd-csr-red {
    background-color: #FEE2E2;
}

.rmd-csr-yellow {
    background-color: #FEF3C7;
}

.rmd-csr-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.rmd-csr-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.rmd-csr-icon {
    color: #6B7280;
    flex-shrink: 0;
}

.rmd-csr-green .rmd-csr-icon {
    color: #16A34A;
}

.rmd-csr-blue .rmd-csr-icon {
    color: #2563EB;
}

.rmd-csr-peach .rmd-csr-icon {
    color: #EA580C;
}

.rmd-csr-pink .rmd-csr-icon {
    color: #DB2777;
}

.rmd-csr-red .rmd-csr-icon {
    color: #DC2626;
}

.rmd-csr-yellow .rmd-csr-icon {
    color: #CA8A04;
}

.rmd-csr-number {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    margin-top: 2px;
}

.rmd-csr-sub {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

/* ── Charts Section ── */
.rmd-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.rmd-chart-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 22px;
    min-width: 0;
}

.rmd-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

    .rmd-chart-head h3 {
        font-size: 15px;
        font-weight: 700;
        color: #111827;
        margin: 0 0 4px 0;
    }

    .rmd-chart-head p {
        font-size: 12px;
        color: #6b7280;
        margin: 0;
    }

.rmd-chart-legend {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: #4b5563;
    flex-wrap: wrap;
}

    .rmd-chart-legend span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-weight: 500;
    }

.legend-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

.legend-blue {
    background-color: #3B82F6;
}

.legend-green {
    background-color: #22C55E;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-teal {
    background-color: #10B981;
}

.dot-yellow {
    background-color: #F59E0B;
}

.dot-red {
    background-color: #EF4444;
}

.dot-gray {
    background-color: #9CA3AF;
}

.dot-coral {
    background-color: #FCA5A5;
}

.dot-purple {
    background-color: #C4B5FD;
}

.dot-amber {
    background-color: #F59E0B;
}

.dot-blue {
    background-color: #3B82F6;
}

.rmd-chart-canvas {
    position: relative;
    height: 260px;
    width: 100%;
}

/* ── RM Approval Status ── */
.rmd-approval-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
}

.rmd-approval-chart {
    position: relative;
    height: 220px;
    min-width: 0;
}

.rmd-approval-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.rmd-approval-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.rmd-approval-total {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    margin: 2px 0;
}

.rmd-approval-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.rmd-approval-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #374151;
    gap: 8px;
}

    .rmd-approval-row strong {
        font-weight: 700;
        color: #111827;
    }

    .rmd-approval-row span {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

/* ── RMD Due Status ── */
.rmd-due-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
}

.rmd-due-chart {
    position: relative;
    height: 220px;
    min-width: 0;
}

.rmd-due-tooltip {
    position: absolute;
    top: 38%;
    left: 38%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    text-align: left;
    min-width: 90px;
    z-index: 5;
}

.rmd-due-tooltip-title {
    font-size: 11px;
    color: #F87171;
    font-weight: 600;
}

.rmd-due-tooltip-text {
    font-size: 13px;
    color: #111827;
    font-weight: 700;
    margin: 2px 0 6px;
}

.rmd-due-tooltip-btn {
    background-color: #3B82F6;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.rmd-due-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.rmd-due-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #374151;
    gap: 8px;
}

    .rmd-due-row span {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .rmd-due-row strong {
        font-weight: 700;
        color: #111827;
        white-space: nowrap;
    }

    .rmd-due-row em {
        font-style: normal;
        color: #6b7280;
        font-weight: 500;
        font-size: 12px;
        margin-left: 2px;
    }

    .rmd-due-row small {
        color: #9ca3af;
        font-size: 10px;
        margin-left: 2px;
    }

/* ── Red Alert Variant ── */
.rmd-alert-danger {
    background-color: #FEF2F2;
    border: 1px solid #FECACA;
    border-left: 4px solid #EF4444;
    margin-top: 18px;
}

.rmd-alert-icon-red {
    background-color: #FEE2E2;
    color: #DC2626;
}

.rmd-text-red {
    color: #B91C1C;
}

.rmd-text-red-soft {
    color: #DC2626;
}

.rmd-btn-red {
    background-color: #DC2626;
}

    .rmd-btn-red:hover {
        background-color: #B91C1C;
    }

/* ── Generic Section Card ── */
.rmd-section-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 22px;
    margin-top: 18px;
    min-width: 0;
}

.rmd-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 14px 0;
}

.rmd-section-sub {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
    margin-left: 4px;
}

.rmd-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

    .rmd-section-head .rmd-section-title {
        margin: 0;
    }

.rmd-link-all {
    font-size: 12px;
    font-weight: 600;
    color: #2563EB;
    text-decoration: none;
    white-space: nowrap;
}

    .rmd-link-all:hover {
        text-decoration: underline;
    }

/* ── Pills ── */
.rmd-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.rmd-pill-red {
    background-color: #FEE2E2;
    color: #B91C1C;
}

.rmd-pill-amber {
    background-color: #FEF3C7;
    color: #B45309;
}

.rmd-pill-green {
    background-color: #DCFCE7;
    color: #15803D;
}

.rmd-pill-blue {
    background-color: #DBEAFE;
    color: #1D4ED8;
}

/* ── Quick Actions ── */
.rmd-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.rmd-quick-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.rmd-quick-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rmd-quick-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    min-width: 0;
}

.rmd-quick-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.rmd-quick-link {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #2563EB;
    text-decoration: none;
}

    .rmd-quick-link:hover {
        color: #1D4ED8;
    }

/* ── Table ── */
.rmd-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rmd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 800px;
}

    .rmd-table thead th {
        text-align: left;
        padding: 12px 14px;
        background-color: #F9FAFB;
        font-size: 12px;
        font-weight: 600;
        color: #6B7280;
        border-bottom: 1px solid #e5e7eb;
        white-space: nowrap;
    }

    .rmd-table tbody td {
        padding: 14px;
        color: #374151;
        border-bottom: 1px solid #f3f4f6;
        vertical-align: middle;
    }

    .rmd-table tbody tr:last-child td {
        border-bottom: none;
    }

    .rmd-table tbody tr:hover {
        background-color: #FAFAFA;
    }

    .rmd-th-check,
    .rmd-table tbody td:first-child {
        width: 36px;
    }

    .rmd-table input[type="checkbox"] {
        width: 14px;
        height: 14px;
        accent-color: #2563EB;
        cursor: pointer;
    }

.rmd-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.15s;
}

    .rmd-icon-btn:hover {
        background-color: #EFF6FF;
    }

/* ── Two-Column Grid (Recent Activity + System Updates) ── */
.rmd-twocol-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 18px;
}

    .rmd-twocol-grid .rmd-section-card {
        margin-top: 0;
    }

/* ── Activity List ── */
.rmd-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
}

    .rmd-activity-list li {
        display: flex;
        align-items: flex-start;
        gap: 14px;
        position: relative;
    }

        .rmd-activity-list li:not(:last-child)::before {
            content: '';
            position: absolute;
            left: 6px;
            top: 18px;
            bottom: -18px;
            width: 1.5px;
            background-color: #D1FAE5;
            z-index: 0;
        }

.rmd-activity-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background-color: #6EE7B7;
    border: 2px solid #ECFDF5;
    margin-top: 3px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.rmd-activity-body {
    flex: 1;
    padding-top: 1px;
    min-width: 0;
}

.rmd-activity-text {
    font-size: 13px;
    color: #1F2937;
    line-height: 1.5;
    font-weight: 500;
    word-break: break-word;
}

    .rmd-activity-text strong {
        font-weight: 500;
        color: #1F2937;
    }

.rmd-activity-muted {
    color: #9CA3AF;
    font-weight: 500;
}

.rmd-activity-time {
    font-size: 11px;
    color: #9CA3AF;
    margin-top: 3px;
}

/* ── Updates List ── */
.rmd-updates-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .rmd-updates-list li {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        background-color: #F9FAFB;
        border-radius: 8px;
    }

.rmd-update-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rmd-update-body {
    flex: 1;
    min-width: 0;
}

.rmd-update-text {
    font-size: 13px;
    color: #1F2937;
    font-weight: 500;
    word-break: break-word;
}

.rmd-update-time {
    font-size: 11px;
    color: #9CA3AF;
    margin-top: 2px;
}

.rmd-update-end {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════ */

/* ── Large desktop (≤1440px) ── */
@media (max-width: 1440px) {
    .rmd-csr-grid {
        gap: 12px;
    }

    .rmd-budget-amount {
        font-size: 18px;
    }
}

/* ── Mid desktop / laptop (≤1280px) ── */
@media (max-width: 1280px) {
    .rmd-budget-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rmd-csr-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .rmd-charts-grid {
        grid-template-columns: 1fr;
    }

    .rmd-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rmd-twocol-grid {
        grid-template-columns: 1fr;
    }

    .rmd-chart-canvas {
        height: 240px;
    }
}

/* ── Tablet landscape (≤1024px) ── */
@media (max-width: 1024px) {
    .rmd-welcome h1 {
        font-size: 20px;
    }

    .rmd-csr-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .rmd-section-card,
    .rmd-csr-section,
    .rmd-chart-card {
        padding: 18px 18px;
    }

    .rmd-approval-body,
    .rmd-due-body {
        gap: 16px;
    }
}

/* ── Tablet portrait (≤768px) ── */
@media (max-width: 768px) {
    .rmd-wrapper {
        margin-bottom: 24px;
    }

    .rmd-welcome h1 {
        font-size: 18px;
    }

    .rmd-meta {
        font-size: 12px;
        gap: 8px;
    }

    .rmd-meta-sep {
        display: none;
    }

    .rmd-meta-item {
        background-color: #f9fafb;
        padding: 4px 10px;
        border-radius: 12px;
    }

    .rmd-alert {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
    }

    .rmd-alert-content {
        align-items: flex-start;
    }

    .rmd-alert-btn {
        width: 100%;
    }

    .rmd-csr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rmd-csr-card {
        padding: 12px 14px;
        min-height: 86px;
    }

    .rmd-csr-number {
        font-size: 20px;
    }

    .rmd-budget-amount {
        font-size: 18px;
    }

    .rmd-approval-body,
    .rmd-due-body {
        grid-template-columns: 1fr;
    }

    .rmd-approval-chart,
    .rmd-due-chart {
        height: 200px;
    }

    .rmd-due-tooltip {
        position: static;
        transform: none;
        margin: 0 auto 12px;
        max-width: 180px;
    }

    .rmd-chart-canvas {
        height: 220px;
    }

    .rmd-section-card,
    .rmd-csr-section,
    .rmd-chart-card {
        padding: 16px;
    }

    .rmd-section-head {
        flex-wrap: wrap;
    }

    .rmd-section-sub {
        display: block;
        margin-left: 0;
        margin-top: 2px;
    }
}

/* ── Mobile landscape (≤640px) ── */
@media (max-width: 640px) {
    .rmd-quick-grid {
        grid-template-columns: 1fr;
    }

    .rmd-welcome h1 {
        font-size: 17px;
    }

    .rmd-budget-grid {
        gap: 12px;
    }

    .rmd-csr-grid {
        gap: 10px;
    }

    /* ── Mobile Horizontal Scroll Table (DataTables Style) ── */
    .rmd-table-wrap {
        width: 100%;
        overflow-x: auto; /* Triggers horizontal scroll */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        border: 1px solid #e5e7eb; /* Optional: adds a border around the scrollable area */
        border-radius: 8px;
    }

    .rmd-table {
        min-width: 900px; /* Forces the table to stay wide, triggering the scrollbar */
        width: 100%;
        border-collapse: collapse;
    }

        /* Ensure table cells don't wrap and look squished on mobile */
        .rmd-table th,
        .rmd-table td {
            white-space: nowrap;
            padding: 12px 16px;
        }

            /* Ensure the checkbox column stays tight */
            .rmd-th-check,
            .rmd-table td:first-child {
                width: 40px;
                min-width: 40px;
                text-align: center;
            }
}
/* ── Mobile portrait (≤480px) ── */
@media (max-width: 480px) {
    .rmd-budget-grid {
        grid-template-columns: 1fr;
    }

    .rmd-csr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rmd-csr-card {
        padding: 10px 12px;
        min-height: 80px;
    }

    .rmd-csr-number {
        font-size: 18px;
    }

    .rmd-csr-label,
    .rmd-quick-title {
        font-size: 12px;
    }

    .rmd-budget-card {
        padding: 14px 16px;
    }

    .rmd-budget-amount {
        font-size: 17px;
    }

    .rmd-section-title,
    .rmd-csr-title {
        font-size: 14px;
    }

    .rmd-alert-icon {
        width: 36px;
        height: 36px;
    }

    .rmd-alert-title {
        font-size: 13px;
    }

    .rmd-alert-desc {
        font-size: 11px;
    }

    .rmd-chart-canvas,
    .rmd-approval-chart,
    .rmd-due-chart {
        height: 200px;
    }
}

/* ── Small mobile (≤380px) ── */
@media (max-width: 380px) {
    .rmd-csr-grid {
        grid-template-columns: 1fr;
    }

    .rmd-section-card,
    .rmd-csr-section,
    .rmd-chart-card {
        padding: 14px;
    }

    .rmd-alert-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ═══════════════════════════════════════════
   REQUEST ADDITIONAL BUDGET POPUP — UI DESIGN
   ═══════════════════════════════════════════ */

.rmd-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(23, 37, 84, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: 'Inter', sans-serif;
}

.rmd-modal-container {
    background: #ffffff;
    border: 1px solid #e6ece9;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.04);
    width: 100%;
    max-width: 1086px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.rmd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e6efeb;
    padding: 20px 24px;
    gap: 12px;
}

.rmd-modal-title {
    font-size: 26px;
    font-weight: 600;
    line-height: 34px;
    letter-spacing: -0.52px;
    color: #47443f;
    margin: 0;
}

.rmd-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: #14804a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

    .rmd-modal-close:hover {
        background: #f3faf5;
    }

    .rmd-modal-close svg {
        width: 20px;
        height: 20px;
        stroke-width: 2.25;
    }

.rmd-modal-body {
    padding: 24px;
}

.rmd-budget-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rmd-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.rmd-form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.rmd-form-label {
    font-size: 16px;
    font-weight: 600;
    line-height: 20px;
    color: #364153;
}

.rmd-input-wrap {
    position: relative;
}

.rmd-modal-body .rmd-input,
.rmd-modal-body textarea,
.rmd-modal-body select {
    width: 100%;
    background: #f3f3f3;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    padding: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #a4a4a4;
    box-shadow: 4px 4px 12px rgba(255, 255, 255, 0.25), -2px -2px 8px rgba(237, 237, 237, 0.25);
    outline: none;
    transition: border-color 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

    .rmd-modal-body .rmd-input:focus,
    .rmd-modal-body textarea:focus,
    .rmd-modal-body select:focus {
        border-color: #aae4c7;
    }

.rmd-input-wrap .rmd-input {
    padding-right: 40px;
}

.rmd-input-icon {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    color: #98a2b3;
}

    .rmd-input-icon svg {
        width: 16px;
        height: 16px;
        stroke-width: 1.75;
    }

.rmd-select-wrap {
    position: relative;
}

    .rmd-select-wrap select {
        padding-right: 40px;
        cursor: pointer;
    }

    .rmd-select-wrap::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 14px;
        transform: translateY(-50%);
        pointer-events: none;
        width: 10px;
        height: 6px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a4a4a4' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-size: contain;
    }

.rmd-modal-body textarea {
    min-height: 94px;
    resize: none;
}

.rmd-dropzone {
    min-height: 94px;
    border: 1.5px dashed #aae4c7;
    border-radius: 12px;
    background: linear-gradient(323deg, #ffffff 0%, #fdfffd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

    .rmd-dropzone:hover {
        background: #f0fdf5;
    }

.rmd-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.rmd-dropzone-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: #576055;
    margin: 0;
}

.rmd-dropzone-or {
    font-size: 14px;
    font-weight: 400;
    line-height: 21px;
    color: #a4a4a4;
    margin: 0;
}

.rmd-dropzone-sub {
    font-size: 14px;
    font-weight: 400;
    line-height: 21px;
    color: #a4a4a4;
    margin: 0;
}

.rmd-tips-box {
    background: #eff6ff;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 4px 4px 12px rgba(255, 255, 255, 0.25), -2px -2px 8px rgba(237, 237, 237, 0.25);
}

    .rmd-tips-box h2 {
        font-size: 16px;
        font-weight: 600;
        line-height: 24px;
        color: #242424;
        margin: 0 0 4px 0;
    }

    .rmd-tips-box p {
        font-size: 16px;
        font-weight: 400;
        line-height: 24px;
        color: #7c7f83;
        margin: 0;
    }

.rmd-form-actions {
    display: flex;
    justify-content: flex-end;
}

.rmd-actions-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.rmd-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

    .rmd-btn svg {
        flex-shrink: 0;
    }

.rmd-btn-draft {
    background: #f3f3f3;
    color: #838181;
}

    .rmd-btn-draft:hover {
        background: #ececec;
    }

    .rmd-btn-draft svg {
        width: 24px;
        height: 24px;
        stroke-width: 1.5;
        color: #838181;
    }

.rmd-btn-submit {
    background: #3371ce;
    color: #ffffff;
}

    .rmd-btn-submit:hover {
        background: #2f67bb;
    }

    .rmd-btn-submit svg {
        width: 16px;
        height: 16px;
        stroke-width: 2;
    }

/* ── Popup responsive (two-column → single-column) ── */
@media (max-width: 720px) {
    .rmd-form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .rmd-modal-body {
        padding: 16px;
    }

    .rmd-modal-header {
        padding: 16px;
    }

    .rmd-modal-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .rmd-modal-overlay {
        padding: 12px;
    }

    .rmd-form-actions {
        justify-content: stretch;
    }

    .rmd-actions-group {
        width: 100%;
    }

    .rmd-btn {
        flex: 1;
        justify-content: center;
    }

    .rmd-form-label,
    .rmd-modal-body .rmd-input,
    .rmd-modal-body textarea,
    .rmd-modal-body select,
    .rmd-dropzone-title,
    .rmd-tips-box p {
        font-size: 14px;
    }
}

/* ═══════════════════════════════════════════
   ADDITIONAL BUDGET REQUEST PENDING BANNER
   ═══════════════════════════════════════════ */

.rmd-alert-pending {
    margin-top: -6px;
}

.rmd-alert-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.rmd-alert-btn-outline {
    background-color: #ffffff;
    color: #2563EB;
    border: 1px solid #2563EB;
}

    .rmd-alert-btn-outline:hover {
        background-color: #EFF6FF;
        color: #1D4ED8;
    }

@media (max-width: 768px) {
    .rmd-alert-actions {
        width: 100%;
        justify-content: space-between;
    }

    .rmd-alert-btn-outline {
        width: auto;
        flex: 1;
    }
}

@media (max-width: 480px) {
    .rmd-alert-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .rmd-alert-btn-outline {
        width: 100%;
    }
}

/* ═══════════════════════════════════════════
   BUDGET REQUEST STATUS SIDE PANEL — UI DESIGN
   ═══════════════════════════════════════════ */

.rmd-status-overlay {
    position: fixed;
    inset: 0;
    z-index: 1070;
    background: rgba(17, 24, 39, 0.5);
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    font-family: 'Inter', sans-serif;
}

.rmd-status-panel {
    background-color: #ffffff;
    width: 480px;
    max-width: 92vw;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 16px 0 0 16px;
    box-shadow: -12px 0 32px rgba(17, 24, 39, 0.18);
    overflow: hidden;
    animation: rmd-status-slide-in 0.25s ease-out;
}

@keyframes rmd-status-slide-in {
    from {
        transform: translateX(24px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.rmd-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    background-color: #F9FAFB;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.rmd-status-title {
    font-size: 19px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.rmd-status-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.15s, color 0.15s;
}

    .rmd-status-close:hover {
        background-color: #F3F4F6;
        color: #111827;
    }

    .rmd-status-close svg {
        width: 18px;
        height: 18px;
    }

.rmd-status-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.rmd-status-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #16A34A;
    margin: 0 0 10px 0;
}

.rmd-status-card {
    background-color: #F9FAFB;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 16px;
}

.rmd-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid #e5e7eb;
}

.rmd-status-row-last {
    border-bottom: none;
}

.rmd-status-label {
    font-size: 13px;
    color: #6b7280;
    flex-shrink: 0;
}

.rmd-status-value {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    text-align: right;
    word-break: break-word;
}

.rmd-status-link {
    font-size: 13px;
    font-weight: 600;
    color: #2563EB;
    text-decoration: underline;
    text-align: right;
    word-break: break-word;
}

    .rmd-status-link:hover {
        color: #1D4ED8;
    }

.rmd-status-timeline-card {
    background-color: #F9FAFB;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 16px;
}

.rmd-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rmd-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
    padding-bottom: 22px;
}

    .rmd-timeline-item:not(.rmd-timeline-item-last)::before {
        content: '';
        position: absolute;
        left: 6px;
        top: 16px;
        bottom: 2px;
        width: 2px;
        background-color: #e5e7eb;
        z-index: 0;
    }

.rmd-timeline-item-last {
    padding-bottom: 0;
}

.rmd-timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    z-index: 1;
}

.rmd-timeline-dot-green {
    background-color: #86EFAC;
}

.rmd-timeline-dot-amber {
    background-color: #FDE68A;
}

.rmd-timeline-dot-gray {
    background-color: #E5E7EB;
}

.rmd-timeline-body {
    min-width: 0;
}

.rmd-timeline-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.rmd-timeline-time {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

    .rmd-timeline-time span {
        margin-left: 4px;
    }

.rmd-status-footer {
    flex-shrink: 0;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background-color: #ffffff;
}

.rmd-status-close-btn {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.15s;
}

    .rmd-status-close-btn:hover {
        background-color: #F9FAFB;
    }

@media (max-width: 640px) {
    .rmd-status-panel {
        width: 100%;
        max-width: 100vw;
        border-radius: 0;
    }

    .rmd-status-header,
    .rmd-status-body,
    .rmd-status-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}
