/* =====================================================================
   GAINS — POS Report dashboard (Components/Pages/Reports/*)
   Global stylesheet (loaded in Components/App.razor). All classes are
   prefixed rd-* to avoid collisions with the mu-/uf-/bspl- systems.
   ===================================================================== */

.rd-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #f3f4f6;
}

/* ── Sticky filter bar ─────────────────────────────────────────────── */
.rd-filterbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.rd-fb-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px 22px;
    padding: 12px 20px;
}

.rd-fb-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #374151;
    margin-right: 6px;
}

.rd-fb-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .rd-fb-field label {
        font-size: 13px;
        font-weight: 600;
        color: #4b5563;
        margin: 0;
        white-space: nowrap;
    }

.rd-fb-date {
    position: relative;
    display: flex;
    align-items: center;
}

    .rd-fb-date i {
        position: absolute;
        left: 9px;
        color: #6b7280;
        font-size: 13px;
        pointer-events: none;
    }

    .rd-fb-date input {
        border: 1px solid #d1d5db;
        border-radius: 6px;
        padding: 6px 10px 6px 28px;
        font-size: 13px;
        color: #374151;
        background: #fff;
        min-width: 150px;
    }

.rd-fb-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.rd-btn {
    border: none;
    border-radius: 6px;
    padding: 7px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .rd-btn:disabled {
        opacity: .65;
        cursor: default;
    }

.rd-btn-go {
    background: #22b07d;
}

    .rd-btn-go:hover:not(:disabled) {
        background: #1c9c6e;
    }

.rd-btn-cf {
    background: #3b82f6;
}

    .rd-btn-cf:hover:not(:disabled) {
        background: #2f6fe0;
    }

/* ── Scroll area + responsive grid ─────────────────────────────────── */
.rd-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 18px;
}

.rd-grid-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

/* Tablet & below → single column (never horizontal scroll) */
@media (max-width: 991px) {
    .rd-grid-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── Card ──────────────────────────────────────────────────────────── */
.rd-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rd-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #edeef0;
    flex-wrap: wrap;
}

.rd-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #4b5563;
}

.rd-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.rd-actions-sep {
    width: 1px;
    height: 20px;
    background: #d1d5db;
    margin: 0 4px;
}

.rd-card-body {
    padding: 16px;
    min-height: 90px;
}

.rd-chart-body {
    min-height: 360px;
}

/* ── Toggle buttons (green active / white inactive) ───────────────── */
.rd-toggle {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #4b5563;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

    .rd-toggle:hover {
        background: #f3f4f6;
    }

    .rd-toggle.active {
        background: #22b07d;
        border-color: #22b07d;
        color: #fff;
    }

.rd-toggle-danger.active {
    background: #ef4444;
    border-color: #ef4444;
}

/* ── State placeholders (loading / error / no data) ───────────────── */
.rd-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 120px;
    color: #6b7280;
    font-size: 14px;
}

    .rd-state i {
        font-size: 26px;
        color: #9ca3af;
    }

.rd-state-err {
    color: #b91c1c;
}

    .rd-state-err i {
        color: #ef4444;
    }

/* ── Spinner ──────────────────────────────────────────────────────── */
.rd-spin {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: rd-rot .7s linear infinite;
}

.rd-spin-lg {
    width: 30px;
    height: 30px;
    border-width: 3px;
    border-color: #d1d5db;
    border-top-color: #22b07d;
}

@keyframes rd-rot {
    to {
        transform: rotate(360deg);
    }
}

/* ── Grid / table ─────────────────────────────────────────────────── */
.rd-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rd-grid-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.rd-show {
    font-size: 13px;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rd-pagesize {
    border: 1px solid #d1d5db;
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 13px;
}

.rd-tools {
    display: flex;
    gap: 6px;
    background: #6b7280;
    border-radius: 6px;
    padding: 3px;
}

.rd-xbtn {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
}

    .rd-xbtn:hover {
        background: rgba(255, 255, 255, .18);
    }

.rd-search {
    margin-left: auto;
}

    .rd-search input {
        border: 1px solid #d1d5db;
        border-radius: 6px;
        padding: 5px 10px;
        font-size: 13px;
        min-width: 160px;
    }

.rd-table-wrap {
    overflow-x: auto;
    border: 1px solid #eceef0;
    border-radius: 6px;
}

.rd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .rd-table thead th {
        position: sticky;
        top: 0;
        background: #2b3648;
        color: #fff;
        font-weight: 600;
        text-align: left;
        padding: 10px 12px;
        white-space: nowrap;
        cursor: pointer;
        user-select: none;
    }

        .rd-table thead th i {
            margin-left: 4px;
            opacity: .7;
            font-size: 12px;
        }

    .rd-table tbody td {
        padding: 9px 12px;
        border-top: 1px solid #eef0f2;
        color: #374151;
    }

    .rd-table tbody tr:nth-child(even) {
        background: #f9fafb;
    }

    .rd-table tbody tr:hover {
        background: #eef6f3;
    }

    .rd-table tfoot td {
        background: #2b3648;
        color: #fff;
        font-weight: 700;
        padding: 10px 12px;
    }

.rd-th-idx,
.rd-idx {
    width: 44px;
    text-align: left;
    color: #9ca3af;
}

.rd-num {
    text-align: right !important;
}

.rd-neg {
    color: #dc2626 !important;
}

.rd-empty {
    text-align: center;
    color: #6b7280;
    padding: 24px !important;
}

/* ── Pager ────────────────────────────────────────────────────────── */
.rd-pager {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.rd-page-nav,
.rd-pagenum {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    padding: 5px 11px;
    font-size: 13px;
    border-radius: 5px;
    cursor: pointer;
}

    .rd-page-nav:disabled {
        opacity: .5;
        cursor: default;
    }

    .rd-pagenum.active {
        background: #22b07d;
        border-color: #22b07d;
        color: #fff;
    }

.rd-ellipsis {
    padding: 5px 4px;
    color: #9ca3af;
}

/* ── Summary (Report 1) ───────────────────────────────────────────── */
.rd-summary {
    border: 1px solid #edeef0;
    border-radius: 8px;
    overflow: hidden;
}

.rd-sum-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 14px;
    color: #374151;
}

    .rd-sum-row:nth-child(even) {
        background: #f4f5f7;
    }

    .rd-sum-row span:first-child {
        font-weight: 600;
    }

/* ── Chart container ──────────────────────────────────────────────── */
.rd-chart {
    width: 100%;
    height: 340px;
}

@media (max-width: 575px) {
    .rd-fb-actions {
        margin-left: 0;
    }

    .rd-fb-inner {
        gap: 12px 14px;
    }

    .rd-fb-date input {
        min-width: 120px;
    }
}
