﻿:root {
    --rrms-primary: #2563eb;
    --rrms-primary-dark: #1d4ed8;
    --rrms-secondary: #0f172a;
    --rrms-accent: #10b981;
    --rrms-danger: #ef4444;
    --rrms-warning: #f59e0b;
    --rrms-info: #06b6d4;
    --rrms-bg: #f4f7fb;
    --rrms-surface: #ffffff;
    --rrms-surface-2: #f8fafc;
    --rrms-text: #0f172a;
    --rrms-muted: #64748b;
    --rrms-border: #e2e8f0;
    --rrms-shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.05);
    --rrms-shadow-md: 0 16px 40px rgba(15, 23, 42, 0.08);
    --rrms-radius-xl: 24px;
    --rrms-radius-lg: 20px;
    --rrms-radius-md: 16px;
    --rrms-radius-sm: 12px;
    --rrms-sidebar-width: 280px;
}

html, body {
    height: 100%;
}

    body.rrms-body {
        margin: 0;
        background: linear-gradient(180deg, #f8fbff 0%, var(--rrms-bg) 100%);
        color: var(--rrms-text);
        font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    }

.rrms-shell {
    display: flex;
    min-height: 100vh;
}

.rrms-sidebar {
    width: var(--rrms-sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: 24px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: var(--rrms-shadow-md);
}

.rrms-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 34px;
    padding: 8px 10px;
}

.rrms-brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--rrms-primary) 0%, #60a5fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.35);
}

.rrms-brand-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
}

.rrms-brand-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,.75);
    margin-top: 4px;
    line-height: 1.4;
}

.rrms-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rrms-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.88);
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 14px;
    transition: all .2s ease;
    font-weight: 500;
}

    .rrms-nav-link i {
        font-size: 18px;
        width: 20px;
    }

    .rrms-nav-link:hover {
        background: rgba(255,255,255,.08);
        color: #fff;
        transform: translateX(2px);
    }

    .rrms-nav-link.active {
        background: linear-gradient(135deg, var(--rrms-primary) 0%, #3b82f6 100%);
        color: #fff;
        box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
    }

.rrms-main {
    flex: 1;
    min-width: 0;
    padding: 28px;
}

.rrms-topbar {
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226,232,240,.9);
    box-shadow: var(--rrms-shadow-sm);
    border-radius: var(--rrms-radius-xl);
    padding: 22px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.rrms-page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--rrms-text);
}

.rrms-page-subtitle {
    color: var(--rrms-muted);
    font-size: 14px;
    margin-top: 6px;
}

.rrms-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rrms-userbox {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--rrms-surface-2);
    border: 1px solid var(--rrms-border);
    border-radius: 16px;
    padding: 10px 14px;
}

.rrms-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: var(--rrms-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.rrms-user-name {
    font-weight: 600;
    line-height: 1.1;
}

.rrms-user-role {
    font-size: 12px;
    color: var(--rrms-muted);
    margin-top: 4px;
}

.rrms-page {
    padding: 4px 0 18px;
}

.rrms-card {
    background: var(--rrms-surface);
    border: 1px solid var(--rrms-border);
    border-radius: var(--rrms-radius-lg);
    box-shadow: var(--rrms-shadow-sm);
    padding: 22px;
}

.rrms-kpi-card {
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rrms-mini-kpi {
    min-height: 106px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rrms-kpi-title {
    font-size: 14px;
    color: var(--rrms-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.rrms-kpi-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    color: var(--rrms-secondary);
}

.rrms-kpi-sub {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--rrms-secondary);
}

.rrms-section-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--rrms-secondary);
}

.rrms-activity-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rrms-activity-item {
    display: grid;
    grid-template-columns: 16px 1fr auto;
    gap: 12px;
    align-items: start;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--rrms-border);
}

    .rrms-activity-item:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

.rrms-activity-dot {
    width: 10px;
    height: 10px;
    background: var(--rrms-primary);
    border-radius: 50%;
    margin-top: 7px;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
}

.rrms-activity-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.rrms-activity-subtitle {
    color: var(--rrms-muted);
    font-size: 13px;
}

.rrms-activity-time {
    color: var(--rrms-muted);
    font-size: 12px;
    white-space: nowrap;
}

.rrms-btn-outline {
    border: 1px solid var(--rrms-border);
    background: #fff;
    color: var(--rrms-secondary);
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 600;
}

    .rrms-btn-outline:hover {
        background: var(--rrms-surface-2);
        color: var(--rrms-primary-dark);
    }

.table {
    --bs-table-bg: transparent;
}

    .table thead th {
        color: var(--rrms-muted);
        font-size: 13px;
        font-weight: 700;
        border-bottom-width: 1px;
    }

    .table td {
        vertical-align: middle;
    }

.form-control,
.form-select {
    border-radius: 14px;
    min-height: 48px;
    border-color: var(--rrms-border);
    box-shadow: none;
}

    .form-control:focus,
    .form-select:focus {
        border-color: #93c5fd;
        box-shadow: 0 0 0 0.2rem rgba(37,99,235,.12);
    }

.btn {
    border-radius: 14px;
    font-weight: 600;
    padding: 10px 16px;
}

.alert {
    border-radius: 16px;
    border: 0;
    box-shadow: var(--rrms-shadow-sm);
}

@media (max-width: 1100px) {
    .rrms-sidebar {
        width: 92px;
        padding: 20px 12px;
    }

    .rrms-brand-subtitle,
    .rrms-brand-title,
    .rrms-nav-link span {
        display: none;
    }

    .rrms-brand {
        justify-content: center;
    }

    .rrms-nav-link {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .rrms-shell {
        flex-direction: column;
    }

    .rrms-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .rrms-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .rrms-main {
        padding: 18px;
    }

    .rrms-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .rrms-topbar-right {
        width: 100%;
        justify-content: space-between;
    }
}


.rrms-nav-group {
    margin-bottom: 1.35rem;
}

.rrms-nav-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8b95a7;
    margin: 0 0 0.55rem 0.25rem;
}

.rrms-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    color: #334155;
    text-decoration: none;
    margin-bottom: 0.35rem;
    transition: all 0.2s ease-in-out;
}

    .rrms-nav-link:hover {
        background: #eef4ff;
        color: #0f172a;
    }

    .rrms-nav-link.active {
        background: #dbeafe;
        color: #1d4ed8;
        font-weight: 600;
    }

    .rrms-nav-link i {
        font-size: 1rem;
        width: 1.1rem;
        text-align: center;
    }


.rrms-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #172554 100%);
    color: #fff;
    min-height: 100vh;
    overflow-y: auto;
}

.rrms-nav {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.rrms-nav-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rrms-nav-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,.58);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0.25rem;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

    .rrms-nav-group-toggle:hover {
        color: rgba(255,255,255,.9);
    }

    .rrms-nav-group-toggle i {
        transition: transform .2s ease;
        font-size: 0.8rem;
    }

    .rrms-nav-group-toggle.open i {
        transform: rotate(180deg);
    }

.rrms-nav-submenu {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-left: 0;
}

.rrms-nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0.95rem;
    border-radius: 14px;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    transition: all .2s ease-in-out;
}

    .rrms-nav-link i {
        width: 1.15rem;
        text-align: center;
        font-size: 1rem;
    }

    .rrms-nav-link:hover {
        color: #fff;
        background: rgba(255,255,255,.08);
    }

    .rrms-nav-link.active {
        color: #1d4ed8;
        background: #eaf2ff;
        box-shadow: 0 10px 24px rgba(59,130,246,.16);
    }

        .rrms-nav-link.active i,
        .rrms-nav-link.active span {
            color: #1d4ed8;
        }



.rrms-dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rrms-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.rrms-page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rrms-btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 10px 16px;
    font-weight: 600;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

    .rrms-btn-primary:hover {
        color: #fff;
        background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    }

.rrms-btn-outline {
    border: 1px solid #dbe2ea;
    background: #fff;
    color: #0f172a;
    border-radius: 14px;
    padding: 10px 16px;
    font-weight: 600;
}

    .rrms-btn-outline:hover {
        background: #f8fafc;
        color: #0f172a;
    }

.rrms-stat-card {
    position: relative;
    overflow: hidden;
    min-height: 168px;
    padding: 22px;
    border-radius: 24px;
}

    .rrms-stat-card::after {
        content: "";
        position: absolute;
        right: -30px;
        top: -30px;
        width: 110px;
        height: 110px;
        border-radius: 999px;
        background: rgba(255,255,255,.16);
    }

.rrms-stat-card-primary {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border: 1px solid #dbeafe;
}

.rrms-stat-card-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
    border: 1px solid #d1fae5;
}

.rrms-stat-card-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
    border: 1px solid #fef3c7;
}

.rrms-stat-card-danger {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
    border: 1px solid #fee2e2;
}

.rrms-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #2563eb;
    font-size: 20px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, .06);
    margin-bottom: 16px;
}

.rrms-stat-label {
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.rrms-stat-value {
    font-size: 38px;
    line-height: 1;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

.rrms-stat-foot {
    font-size: 13px;
    color: #64748b;
}

.rrms-mini-stat-card {
    min-height: 126px;
    border-radius: 22px;
    padding: 22px;
}

.rrms-mini-stat-danger {
    background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%);
    border-color: #ffe4e6;
}

.rrms-mini-stat-title {
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.rrms-mini-stat-value {
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 10px;
}

.rrms-mini-stat-note {
    color: #94a3b8;
    font-size: 12px;
}

.rrms-panel-card {
    border-radius: 24px;
    padding: 22px;
}

.rrms-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 18px;
}

.rrms-panel-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.rrms-panel-subtitle {
    color: #64748b;
    font-size: 13px;
    margin-top: 4px;
}

.rrms-panel-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #d1fae5;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

.rrms-chart-wrap {
    position: relative;
    width: 100%;
    height: 330px;
}

.rrms-chart-wrap-donut {
    height: 330px;
}

.rrms-activity-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rrms-activity-item {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

    .rrms-activity-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

.rrms-activity-dot {
    width: 10px;
    height: 10px;
    background: #2563eb;
    border-radius: 50%;
    margin-top: 7px;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
}

.rrms-activity-content {
    min-width: 0;
}

.rrms-activity-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.rrms-activity-subtitle {
    color: #64748b;
    font-size: 13px;
}

.rrms-activity-time {
    color: #94a3b8;
    font-size: 12px;
    white-space: nowrap;
    padding-top: 2px;
}

.rrms-error-text {
    max-width: 340px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #475569;
}

.rrms-empty-state {
    min-height: 180px;
    border: 1px dashed #dbe2ea;
    border-radius: 20px;
    background: #fafcff;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
}

    .rrms-empty-state i {
        font-size: 30px;
        color: #94a3b8;
    }

.rrms-table {
    margin-bottom: 0;
}

    .rrms-table thead th {
        border-bottom: 1px solid #e5e7eb;
        color: #64748b;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: .04em;
        font-weight: 700;
    }

    .rrms-table tbody td {
        padding-top: 14px;
        padding-bottom: 14px;
        border-color: #f1f5f9;
    }

@media (max-width: 992px) {
    .rrms-chart-wrap,
    .rrms-chart-wrap-donut {
        height: 280px;
    }
}

@media (max-width: 768px) {
    .rrms-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .rrms-page-actions {
        width: 100%;
    }

        .rrms-page-actions .btn {
            width: 100%;
            justify-content: center;
        }

    .rrms-stat-value {
        font-size: 32px;
    }

    .rrms-mini-stat-value {
        font-size: 26px;
    }

    .rrms-chart-wrap,
    .rrms-chart-wrap-donut {
        height: 240px;
    }

    .rrms-activity-item {
        grid-template-columns: 12px 1fr;
    }

    .rrms-activity-time {
        grid-column: 2;
    }
}


.rrms-badge {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.rrms-badge-completed {
    background: #ecfdf5;
    color: #047857;
}

.rrms-badge-failed {
    background: #fef2f2;
    color: #b91c1c;
}

.rrms-badge-processing {
    background: #fffbeb;
    color: #92400e;
}

.rrms-badge-pending {
    background: #f1f5f9;
    color: #475569;
}

.rrms-health-card {
    min-height: 132px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 8px;
}

.rrms-health-ok {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.rrms-health-warn {
    border-color: #fed7aa;
    background: #fff7ed;
}

.rrms-health-icon {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #2563eb;
    font-size: 22px;
}

.rrms-health-title {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.rrms-health-value {
    color: #0f172a;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.2;
    margin-top: 4px;
}

.rrms-health-note {
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
}

.rrms-quick-actions {
    display: grid;
    gap: 10px;
}

.rrms-quick-actions a {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    color: #0f172a;
    text-decoration: none;
    background: #fff;
    font-weight: 700;
}

.rrms-quick-actions a:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.rrms-report-tile {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #0f172a;
    text-decoration: none;
}

.rrms-report-tile i {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 22px;
}

.rrms-report-tile strong {
    font-size: 18px;
}

.rrms-report-tile span {
    color: #64748b;
}

.rrms-report-tile:hover {
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.rrms-coming-soon {
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
}

.rrms-coming-soon i {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 34px;
}

.rrms-coming-soon h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 900;
}

.rrms-coming-soon p {
    max-width: 620px;
    margin: 0;
    color: #64748b;
}

/* RRMS brand refresh inspired by the supplied logo */
:root {
    --rrms-primary: #075da8;
    --rrms-primary-dark: #062b63;
    --rrms-secondary: #041d45;
    --rrms-accent: #19c8c3;
    --rrms-danger: #e5484d;
    --rrms-warning: #f5b84b;
    --rrms-info: #0f8fc9;
    --rrms-bg: #f5f9fc;
    --rrms-surface: #ffffff;
    --rrms-surface-2: #f8fbfd;
    --rrms-text: #08213f;
    --rrms-muted: #5d7188;
    --rrms-border: #dbe8f0;
    --rrms-shadow-sm: 0 8px 22px rgba(4, 29, 69, 0.06);
    --rrms-shadow-md: 0 18px 42px rgba(4, 29, 69, 0.10);
    --rrms-radius-xl: 18px;
    --rrms-radius-lg: 14px;
    --rrms-radius-md: 12px;
    --rrms-radius-sm: 10px;
}

body.rrms-body {
    background:
        radial-gradient(circle at top right, rgba(25, 200, 195, .10), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, var(--rrms-bg) 100%);
    color: var(--rrms-text);
}

.rrms-shell {
    min-height: 100vh;
}

body.rrms-rtl .rrms-sidebar {
    order: 2;
}

body.rrms-rtl .rrms-main {
    order: 1;
}

body.rrms-ltr .rrms-sidebar {
    order: 1;
}

body.rrms-ltr .rrms-main {
    order: 2;
}

.rrms-sidebar {
    background:
        linear-gradient(180deg, rgba(25, 200, 195, .10), transparent 18%),
        linear-gradient(180deg, #062b63 0%, #041d45 100%);
    border: 0;
    box-shadow: -18px 0 38px rgba(4, 29, 69, .14);
}

body.rrms-ltr .rrms-sidebar {
    box-shadow: 18px 0 38px rgba(4, 29, 69, .14);
}

.rrms-brand-mark,
.rrms-brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--rrms-accent) 0%, var(--rrms-primary) 52%, var(--rrms-primary-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 22px;
    box-shadow: 0 14px 28px rgba(25, 200, 195, .20);
}

.rrms-brand-title {
    letter-spacing: .08em;
}

.rrms-nav-single {
    margin-bottom: 6px;
}

.rrms-nav-group-toggle {
    border-radius: var(--rrms-radius-sm);
}

.rrms-nav-link {
    border-radius: var(--rrms-radius-sm);
    color: rgba(255,255,255,.78);
}

.rrms-nav-link:hover,
.rrms-nav-group-toggle:hover {
    background: rgba(255,255,255,.08);
}

.rrms-nav-link.active {
    background: linear-gradient(135deg, var(--rrms-accent) 0%, var(--rrms-primary) 100%);
    box-shadow: 0 12px 26px rgba(7, 93, 168, .30);
}

.rrms-sidebar-collapsed .rrms-nav-submenu.open {
    display: flex;
}

.rrms-topbar {
    border-radius: var(--rrms-radius-lg);
    border: 1px solid rgba(219, 232, 240, .9);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
}

.rrms-breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--rrms-muted);
    font-size: 12px;
    margin-top: 4px;
}

.rrms-global-search {
    min-width: 260px;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--rrms-border);
    background: var(--rrms-surface-2);
    border-radius: var(--rrms-radius-sm);
    padding: 0 12px;
    color: var(--rrms-muted);
}

.rrms-global-search input {
    border: 0;
    outline: 0;
    background: transparent;
    width: 100%;
    color: var(--rrms-text);
}

.rrms-icon-btn,
.rrms-language-switch,
.rrms-user-menu {
    border-radius: var(--rrms-radius-sm);
    border-color: var(--rrms-border);
}

.rrms-notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--rrms-accent);
    position: absolute;
    transform: translate(-5px, -8px);
}

.rrms-notification-dot-active {
    box-shadow: 0 0 0 6px rgba(14, 165, 233, 0.18);
}

.rrms-user-menu {
    border: 1px solid var(--rrms-border);
    background: var(--rrms-surface-2);
}

.rrms-user-chevron {
    color: var(--rrms-muted);
    font-size: 12px;
}

.rrms-profile-menu {
    border: 1px solid var(--rrms-border);
    border-radius: var(--rrms-radius-sm);
    box-shadow: var(--rrms-shadow-md);
}

.rrms-card,
.rrms-panel-card,
.rrms-mini-stat-card,
.rrms-stat-card,
.card {
    border-radius: var(--rrms-radius-lg) !important;
    border-color: var(--rrms-border) !important;
    box-shadow: var(--rrms-shadow-sm);
}

.rrms-card:hover,
.rrms-stat-card:hover,
.rrms-mini-stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--rrms-shadow-md);
    transition: transform .18s ease, box-shadow .18s ease;
}

.rrms-btn-primary,
.btn-primary {
    background: linear-gradient(135deg, var(--rrms-accent) 0%, var(--rrms-primary) 60%, var(--rrms-primary-dark) 100%) !important;
    border: 0 !important;
    color: #fff !important;
}

.rrms-btn-outline,
.btn-outline-primary,
.btn-outline-secondary {
    border-color: var(--rrms-border) !important;
    color: var(--rrms-primary-dark) !important;
    background: #fff !important;
}

.rrms-btn-outline:hover,
.btn-outline-primary:hover,
.btn-outline-secondary:hover {
    background: #edf9fb !important;
    color: var(--rrms-primary) !important;
}

.form-control,
.form-select {
    border-radius: var(--rrms-radius-sm);
    border-color: var(--rrms-border);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--rrms-accent);
    box-shadow: 0 0 0 .2rem rgba(25, 200, 195, .14);
}

.rrms-table thead th,
.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fbfd;
}

.badge,
.rrms-badge {
    border-radius: 999px;
}

@media (max-width: 992px) {
    .rrms-global-search {
        width: 100%;
        min-width: 0;
    }

    body.rrms-rtl .rrms-sidebar {
        right: 0;
        left: auto;
    }

    body.rrms-ltr .rrms-sidebar {
        left: 0;
        right: auto;
    }

    body.rrms-rtl .rrms-sidebar-collapsed .rrms-sidebar {
        transform: translateX(100%);
    }

    body.rrms-ltr .rrms-sidebar-collapsed .rrms-sidebar {
        transform: translateX(-100%);
    }
}

/* Direction rules: Arabic => right sidebar, English => left sidebar */
body.rrms-rtl .rrms-shell,
body.rrms-ltr .rrms-shell {
    flex-direction: row !important;
}

body.rrms-rtl .rrms-sidebar {
    order: 2 !important;
}

body.rrms-rtl .rrms-main {
    order: 1 !important;
}

body.rrms-ltr .rrms-sidebar {
    order: 1 !important;
}

body.rrms-ltr .rrms-main {
    order: 2 !important;
}

.rrms-brand-logo-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    padding: 4px;
    box-shadow: 0 14px 28px rgba(25, 200, 195, .16);
    flex: 0 0 auto;
}

.rrms-sidebar-collapsed .rrms-brand-logo-img {
    width: 44px;
    height: 44px;
}

.rrms-login-body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 12% 16%, rgba(25, 200, 195, .18), transparent 28%),
        radial-gradient(circle at 86% 12%, rgba(7, 93, 168, .16), transparent 26%),
        linear-gradient(135deg, #ffffff 0%, #f5f9fc 100%);
    color: var(--rrms-text);
}

.rrms-login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
}

.rrms-login-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(32px, 6vw, 84px);
    background:
        linear-gradient(135deg, rgba(4, 29, 69, .96), rgba(7, 93, 168, .92)),
        linear-gradient(135deg, var(--rrms-accent), var(--rrms-primary));
    color: #fff;
}

.rrms-login-logo {
    width: min(380px, 72%);
    max-height: 380px;
    object-fit: contain;
    background: #fff;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 24px 60px rgba(0,0,0,.18);
    margin-bottom: 34px;
}

.rrms-login-brand-copy h1 {
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.08;
    font-weight: 900;
    max-width: 760px;
}

.rrms-login-brand-copy p {
    max-width: 620px;
    color: rgba(255,255,255,.78);
    font-size: 16px;
    margin-top: 16px;
}

.rrms-login-card-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.rrms-login-card {
    width: min(440px, 100%);
    background: rgba(255,255,255,.94);
    border: 1px solid var(--rrms-border);
    border-radius: 18px;
    box-shadow: var(--rrms-shadow-md);
    padding: 28px;
}

.rrms-login-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.rrms-login-card-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid var(--rrms-border);
    background: #fff;
    padding: 4px;
}

.rrms-login-card-head h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
}

.rrms-login-card-head p {
    margin: 4px 0 0;
    color: var(--rrms-muted);
    font-size: 13px;
}

.rrms-activation-page {
    display: flex;
    justify-content: center;
    padding: 24px 0 60px;
}

.rrms-activation-card {
    width: min(820px, 100%);
}

.rrms-activation-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--rrms-border);
}

.rrms-activation-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid var(--rrms-border);
    background: #fff;
    padding: 6px;
}

.rrms-activation-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 900;
}

.rrms-activation-header p {
    margin: 6px 0 0;
    color: var(--rrms-muted);
}

.rrms-code-field {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}

@media (max-width: 900px) {
    .rrms-login-shell {
        grid-template-columns: 1fr;
    }

    .rrms-login-brand-panel {
        min-height: auto;
        padding: 30px;
    }

    .rrms-login-logo {
        width: 170px;
        margin-bottom: 18px;
    }
}

/* Final direction guard: English = left menu, Arabic = right menu */
body.rrms-ltr .rrms-shell {
    flex-direction: row !important;
}

body.rrms-ltr .rrms-sidebar {
    order: 0 !important;
}

body.rrms-ltr .rrms-main {
    order: 1 !important;
}

body.rrms-rtl .rrms-shell {
    flex-direction: row !important;
}

body.rrms-rtl .rrms-sidebar {
    order: 1 !important;
}

body.rrms-rtl .rrms-main {
    order: 0 !important;
}

/* RTL-first enterprise admin shell */
body.rrms-body {
    direction: rtl;
    background: #f5f7fb;
}

body.rrms-ltr {
    direction: ltr;
}

.rrms-shell {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

body.rrms-ltr .rrms-shell {
    flex-direction: row-reverse;
}

.rrms-main {
    flex: 1;
    min-width: 0;
    padding: 18px;
    transition: margin .2s ease;
}

.rrms-sidebar {
    width: 292px;
    flex: 0 0 292px;
    background: #0f172a;
    color: #fff;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    padding: 18px 14px;
    border-left: 1px solid rgba(255,255,255,.08);
    box-shadow: -10px 0 30px rgba(15, 23, 42, .08);
    transition: width .2s ease, flex-basis .2s ease, transform .2s ease;
    z-index: 1040;
}

body.rrms-ltr .rrms-sidebar {
    border-left: 0;
    border-right: 1px solid rgba(255,255,255,.08);
}

.rrms-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 14px;
}

.rrms-brand-logo {
    flex: 0 0 auto;
}

.rrms-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rrms-nav-group {
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding-bottom: 8px;
}

.rrms-nav-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,.62);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.rrms-nav-group-toggle:hover {
    color: #fff;
}

.rrms-nav-group-toggle i {
    transition: transform .2s ease;
}

.rrms-nav-group-toggle.open i {
    transform: rotate(180deg);
}

.rrms-nav-submenu {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 2px 0 8px;
}

.rrms-nav-submenu.open {
    display: flex;
}

.rrms-nav-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.78);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 0;
}

.rrms-nav-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.rrms-nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
    transform: none;
}

.rrms-nav-link.active {
    color: #fff;
    background: #2563eb;
    box-shadow: none;
}

.rrms-nav-link.active i,
.rrms-nav-link.active span {
    color: #fff;
}

.rrms-sidebar-collapsed .rrms-sidebar {
    width: 76px;
    flex-basis: 76px;
}

.rrms-sidebar-collapsed .rrms-brand-text,
.rrms-sidebar-collapsed .rrms-nav-group-toggle span,
.rrms-sidebar-collapsed .rrms-nav-link span {
    display: none;
}

.rrms-sidebar-collapsed .rrms-sidebar-brand,
.rrms-sidebar-collapsed .rrms-nav-link,
.rrms-sidebar-collapsed .rrms-nav-group-toggle {
    justify-content: center;
}

.rrms-sidebar-collapsed .rrms-nav-group-toggle i {
    display: none;
}

.rrms-topbar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15,23,42,.04);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.rrms-topbar-start,
.rrms-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rrms-topbar-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.rrms-topbar-subtitle {
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
}

.rrms-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #334155;
    border-radius: 8px;
}

.rrms-icon-btn:hover {
    background: #f8fafc;
}

.rrms-language-switch {
    min-height: 38px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #334155;
    border-radius: 8px;
    padding: 0 12px;
    font-weight: 700;
}

.rrms-user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 8px;
    padding: 6px 10px;
}

.rrms-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    color: #1d4ed8;
}

.rrms-user-name {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
}

.rrms-user-role {
    font-size: 11px;
    color: #64748b;
}

.rrms-content {
    min-width: 0;
}

.rrms-card,
.rrms-panel-card,
.rrms-mini-stat-card,
.rrms-stat-card {
    border-radius: 8px;
}

@media (max-width: 992px) {
    .rrms-shell {
        display: block;
    }

    .rrms-sidebar {
        position: fixed;
        right: 0;
        top: 0;
        transform: translateX(0);
    }

    .rrms-sidebar-collapsed .rrms-sidebar {
        transform: translateX(100%);
        width: 292px;
        flex-basis: 292px;
    }

    .rrms-sidebar-collapsed .rrms-brand-text,
    .rrms-sidebar-collapsed .rrms-nav-group-toggle span,
    .rrms-sidebar-collapsed .rrms-nav-link span {
        display: block;
    }

    .rrms-main {
        padding: 12px;
    }

    .rrms-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .rrms-topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}
