:root {
    --rmg-primary: #0a234a;
    --rmg-secondary: #1e3aff;
    --rmg-accent: #1e6bff;
    --rmg-sidebar-start: #071f47;
    --rmg-sidebar-end: #023b77;
    --rmg-radius: 16px;
    --rmg-bg: #f6f9ff;
    --rmg-card: rgba(255, 255, 255, 0.93);
    --rmg-border: #e3eaf5;
    --rmg-text: #0a234a;
    --rmg-muted: #6e7d96;
    --rmg-success: #00a86b;
    --rmg-warning: #e89722;
    --rmg-danger: #d4484c;
    --rmg-shadow: 0 10px 28px rgba(33, 64, 111, 0.08);
    --rmg-shadow-hover: 0 16px 38px rgba(33, 64, 111, 0.14);
    --rmg-sidebar-width: 248px;
    --rmg-topbar-height: 76px;
    font-family: Poppins, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body.rmg-app-page { background: var(--rmg-bg); color: var(--rmg-text); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.rmg-loading-screen,
.rmg-auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 15%, rgba(30, 107, 255, 0.13), transparent 28%),
        radial-gradient(circle at 85% 10%, rgba(30, 58, 255, 0.10), transparent 26%),
        linear-gradient(135deg, #f5f9ff, #ffffff);
}
.rmg-loading-screen { align-content: center; gap: 14px; color: var(--rmg-muted); }
.rmg-loader-mark,
.rmg-logo-mark {
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--rmg-primary);
    border: 4px solid var(--rmg-primary);
    font-weight: 800;
    letter-spacing: -2px;
    border-radius: 12px;
}
.rmg-loader-mark { width: 76px; height: 58px; font-size: 24px; animation: rmgPulse 1.35s ease-in-out infinite; }
@keyframes rmgPulse { 50% { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(30, 107, 255, .18); } }

.rmg-auth-card {
    width: min(100%, 980px);
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(300px, .9fr) minmax(360px, 1.1fr);
    overflow: hidden;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(219,229,243,.9);
    border-radius: 26px;
    box-shadow: 0 30px 80px rgba(22, 58, 107, .15);
}
.rmg-auth-brand {
    padding: 44px;
    color: #fff;
    background:
        radial-gradient(circle at 70% 20%, rgba(47, 128, 255, .36), transparent 30%),
        linear-gradient(155deg, var(--rmg-sidebar-start), var(--rmg-sidebar-end));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.rmg-brand-lockup { display: flex; align-items: center; gap: 14px; }
.rmg-logo-mark { width: 68px; height: 52px; flex: 0 0 auto; border-color: #fff; color: #fff; background: rgba(255,255,255,.08); }
.rmg-brand-copy strong { display: block; font-size: 15px; letter-spacing: .02em; }
.rmg-brand-copy span { display: block; font-size: 12px; opacity: .75; line-height: 1.35; }
.rmg-auth-brand h1 { margin: 0 0 16px; font-size: clamp(32px, 4vw, 52px); line-height: 1.06; letter-spacing: -.04em; }
.rmg-auth-brand p { max-width: 420px; color: rgba(255,255,255,.76); line-height: 1.7; }
.rmg-auth-feature-list { display: grid; gap: 12px; margin-top: 26px; }
.rmg-auth-feature { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.88); font-size: 13px; }
.rmg-auth-feature span:first-child { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); }
.rmg-auth-form-wrap { padding: 54px clamp(28px, 5vw, 66px); display: flex; flex-direction: column; justify-content: center; }
.rmg-auth-form-wrap h2 { margin: 0 0 8px; font-size: 29px; letter-spacing: -.035em; }
.rmg-auth-form-wrap > p { margin: 0 0 28px; color: var(--rmg-muted); line-height: 1.65; }
.rmg-auth-links { margin-top: 18px; color: var(--rmg-muted); text-align: center; }
.rmg-auth-links a { color: var(--rmg-accent); font-weight: 650; }

.rmg-field { display: grid; gap: 7px; margin-bottom: 16px; }
.rmg-field label { font-weight: 650; font-size: 12px; letter-spacing: .01em; }
.rmg-input,
.rmg-select,
.rmg-textarea {
    width: 100%;
    border: 1px solid var(--rmg-border);
    border-radius: 12px;
    background: #fff;
    color: var(--rmg-text);
    outline: none;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.rmg-input, .rmg-select { height: 46px; padding: 0 14px; }
.rmg-textarea { min-height: 100px; padding: 12px 14px; resize: vertical; }
.rmg-input:focus, .rmg-select:focus, .rmg-textarea:focus { border-color: var(--rmg-accent); box-shadow: 0 0 0 4px rgba(30, 107, 255, .10); }
.rmg-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rmg-checkbox { display: flex; align-items: center; gap: 9px; color: var(--rmg-muted); }
.rmg-checkbox input { width: 17px; height: 17px; accent-color: var(--rmg-accent); }
.rmg-help { font-size: 11px; color: var(--rmg-muted); line-height: 1.55; }

.rmg-btn {
    height: 42px;
    border: 0;
    border-radius: 11px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    transition: transform .18s, box-shadow .18s, background .18s, opacity .18s;
}
.rmg-btn:hover { transform: translateY(-1px); }
.rmg-btn:disabled { cursor: not-allowed; opacity: .58; transform: none; }
.rmg-btn-primary { color: #fff; background: linear-gradient(135deg, var(--rmg-secondary), var(--rmg-accent)); box-shadow: 0 8px 18px rgba(30, 107, 255, .22); }
.rmg-btn-dark { color: #fff; background: var(--rmg-primary); box-shadow: 0 8px 18px rgba(10,35,74,.16); }
.rmg-btn-light { color: var(--rmg-text); background: #fff; border: 1px solid var(--rmg-border); }
.rmg-btn-danger { color: #fff; background: var(--rmg-danger); }
.rmg-btn-sm { height: 34px; padding: 0 11px; border-radius: 9px; font-size: 12px; }
.rmg-btn-block { width: 100%; }

.rmg-app-shell { min-height: 100vh; }
.rmg-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rmg-sidebar-width);
    z-index: 40;
    display: flex;
    flex-direction: column;
    padding: 24px 16px 18px;
    color: #fff;
    background:
        radial-gradient(circle at 30% 2%, rgba(38,112,255,.34), transparent 25%),
        linear-gradient(175deg, var(--rmg-sidebar-start), var(--rmg-sidebar-end));
    box-shadow: 12px 0 36px rgba(4, 27, 62, .12);
    transition: width .25s, transform .25s;
}
.rmg-sidebar .rmg-brand-lockup { padding: 0 4px 22px; }
.rmg-sidebar .rmg-logo-mark { width: 66px; height: 50px; font-size: 20px; }
.rmg-nav { display: grid; gap: 5px; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }
.rmg-nav-item {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.84);
    font-weight: 550;
    transition: background .18s, color .18s, transform .18s;
}
.rmg-nav-item:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(2px); }
.rmg-nav-item.is-active { color: #fff; background: linear-gradient(90deg, rgba(30,107,255,.78), rgba(12,89,205,.58)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 8px 18px rgba(0,0,0,.12); }
.rmg-nav-icon { width: 20px; height: 20px; flex: 0 0 auto; }
.rmg-nav-badge { margin-left: auto; min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; background: rgba(30,107,255,.75); font-size: 11px; font-weight: 800; }
.rmg-sidebar-footer { margin-top: auto; padding-top: 18px; }
.rmg-version-card { border: 1px solid rgba(255,255,255,.13); border-radius: 13px; padding: 14px; background: rgba(255,255,255,.04); }
.rmg-version-card strong { display: block; font-size: 12px; }
.rmg-version-card small { color: rgba(255,255,255,.66); }
.rmg-health { margin-top: 9px; display: flex; align-items: center; gap: 7px; color: #8ff0bd; font-size: 11px; }
.rmg-health-dot { width: 7px; height: 7px; border-radius: 50%; background: #42d690; box-shadow: 0 0 0 4px rgba(66,214,144,.11); }

.rmg-main { min-height: 100vh; margin-left: var(--rmg-sidebar-width); }
.rmg-topbar {
    height: var(--rmg-topbar-height);
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 28px;
    background: rgba(250,252,255,.86);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(225,233,245,.82);
}
.rmg-topbar-title { min-width: 310px; }
.rmg-topbar-title h1 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.rmg-topbar-title p { margin: 4px 0 0; color: var(--rmg-muted); font-size: 11px; }
.rmg-search { max-width: 360px; flex: 1; position: relative; }
.rmg-search input { padding-left: 42px; }
.rmg-search svg { position: absolute; left: 14px; top: 13px; width: 19px; color: var(--rmg-muted); }
.rmg-top-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.rmg-icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rmg-border); background: #fff; color: var(--rmg-text); display: grid; place-items: center; }
.rmg-icon-btn svg { width: 18px; height: 18px; }
.rmg-user-menu { display: flex; align-items: center; gap: 10px; padding-left: 8px; }
.rmg-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--rmg-primary); color: #fff; font-weight: 800; }
.rmg-user-copy strong { display: block; font-size: 11px; }
.rmg-user-copy span { display: block; color: var(--rmg-muted); font-size: 10px; margin-top: 2px; }
.rmg-menu-toggle { display: none; }

.rmg-content { padding: 24px 28px 34px; }
.rmg-page-actions { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 14px; }
.rmg-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.rmg-card {
    background: var(--rmg-card);
    border: 1px solid var(--rmg-border);
    border-radius: var(--rmg-radius);
    box-shadow: var(--rmg-shadow);
    transition: box-shadow .2s, transform .2s;
}
.rmg-card:hover { box-shadow: var(--rmg-shadow-hover); }
.rmg-metric-card { min-height: 112px; padding: 17px; display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; }
.rmg-metric-icon { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(145deg, var(--rmg-primary), #044790); color: #fff; box-shadow: 0 9px 18px rgba(10,35,74,.16); }
.rmg-metric-icon svg { width: 25px; height: 25px; }
.rmg-metric-copy span { display: block; font-weight: 650; font-size: 11px; }
.rmg-metric-copy strong { display: block; font-size: 23px; margin-top: 5px; letter-spacing: -.03em; }
.rmg-trend { margin-top: 7px; font-size: 10px; color: var(--rmg-success); font-weight: 650; }
.rmg-sparkline { width: 92px; height: 38px; }
.rmg-sparkline path { stroke: var(--rmg-accent); stroke-width: 2; fill: none; }

.rmg-dashboard-grid { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, .95fr) 270px; gap: 14px; align-items: start; }
.rmg-dashboard-grid .rmg-span-2 { grid-column: span 2; }
.rmg-panel { padding: 16px; }
.rmg-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rmg-panel-title { display: flex; align-items: center; gap: 8px; }
.rmg-panel-title h2 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.rmg-panel-title small { color: var(--rmg-muted); }
.rmg-link { color: var(--rmg-accent); font-size: 11px; font-weight: 700; }
.rmg-chart-legend { display: flex; gap: 15px; margin-bottom: 8px; color: var(--rmg-muted); font-size: 10px; }
.rmg-legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.rmg-legend-dot.orders { background: var(--rmg-accent); }
.rmg-legend-dot.revenue { background: #c6d9fb; }
.rmg-chart-wrap { height: 230px; position: relative; }
.rmg-chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.rmg-chart-grid-line { stroke: #eaf0f8; stroke-width: 1; }
.rmg-chart-axis { fill: var(--rmg-muted); font-size: 9px; }
.rmg-chart-line { fill: none; stroke: var(--rmg-primary); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.rmg-chart-point { fill: #fff; stroke: var(--rmg-primary); stroke-width: 2; }
.rmg-chart-bar { fill: url(#rmgBars); rx: 4; }

.rmg-table-wrap { width: 100%; overflow-x: auto; }
.rmg-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.rmg-table th { padding: 10px 8px; color: var(--rmg-muted); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; font-weight: 750; text-align: left; border-bottom: 1px solid var(--rmg-border); }
.rmg-table td { padding: 11px 8px; border-bottom: 1px solid #edf2f8; font-size: 11px; vertical-align: middle; }
.rmg-table tr:last-child td { border-bottom: 0; }
.rmg-table tbody tr:hover { background: #f9fbff; }
.rmg-id { font-weight: 750; color: var(--rmg-primary); }
.rmg-person { display: flex; align-items: center; gap: 8px; }
.rmg-mini-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #eef4ff; color: var(--rmg-accent); font-size: 10px; font-weight: 800; }
.rmg-status { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 750; text-transform: capitalize; }
.rmg-status-paid, .rmg-status-approved, .rmg-status-completed, .rmg-status-active { color: #087c52; background: #e2f7ed; }
.rmg-status-pending, .rmg-status-under_review, .rmg-status-processing { color: #b26700; background: #fff0d7; }
.rmg-status-rejected, .rmg-status-cancelled, .rmg-status-failed, .rmg-status-suspended { color: #b42e35; background: #fde7e8; }
.rmg-status-refunded { color: #5b5bb5; background: #ececff; }

.rmg-approval-list, .rmg-activity-list, .rmg-service-list, .rmg-fee-list, .rmg-document-list { display: grid; gap: 5px; }
.rmg-approval-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #edf2f8; }
.rmg-approval-item:last-child { border-bottom: 0; }
.rmg-item-copy strong { display: block; font-size: 10px; }
.rmg-item-copy span { display: block; color: var(--rmg-muted); font-size: 8px; margin-top: 3px; }
.rmg-approval-actions { display: flex; gap: 6px; }
.rmg-activity-item, .rmg-document-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 9px; align-items: center; padding: 8px 0; border-bottom: 1px solid #edf2f8; }
.rmg-activity-icon, .rmg-document-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #edf4ff; color: var(--rmg-accent); }
.rmg-activity-icon svg, .rmg-document-icon svg { width: 15px; height: 15px; }
.rmg-time { color: var(--rmg-muted); font-size: 8px; white-space: nowrap; }
.rmg-service-item, .rmg-fee-item { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #edf2f8; }
.rmg-service-item:last-child, .rmg-fee-item:last-child { border-bottom: 0; }
.rmg-price { font-size: 10px; font-weight: 750; }
.rmg-switch { position: relative; width: 34px; height: 20px; display: inline-block; }
.rmg-switch input { opacity: 0; width: 0; height: 0; }
.rmg-slider { position: absolute; inset: 0; border-radius: 999px; background: #cbd5e5; transition: .2s; }
.rmg-slider::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 2px 5px rgba(0,0,0,.18); }
.rmg-switch input:checked + .rmg-slider { background: var(--rmg-accent); }
.rmg-switch input:checked + .rmg-slider::before { transform: translateX(14px); }

.rmg-quick-settings { margin-top: 14px; padding: 14px; }
.rmg-quick-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)) auto; gap: 10px; align-items: end; }
.rmg-color-input { height: 38px; border: 1px solid var(--rmg-border); border-radius: 9px; padding: 4px 8px; display: flex; align-items: center; gap: 8px; background: #fff; }
.rmg-color-input input[type=color] { width: 22px; height: 24px; padding: 0; border: 0; background: transparent; }
.rmg-color-input code { font-size: 9px; color: var(--rmg-muted); }

.rmg-page-card { padding: 18px; }
.rmg-page-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.rmg-page-head h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.rmg-page-head p { margin: 5px 0 0; color: var(--rmg-muted); font-size: 11px; }
.rmg-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rmg-toolbar .rmg-input, .rmg-toolbar .rmg-select { width: auto; min-width: 180px; }
.rmg-empty { min-height: 220px; display: grid; place-items: center; text-align: center; color: var(--rmg-muted); padding: 24px; }
.rmg-empty strong { display: block; color: var(--rmg-text); font-size: 16px; margin-bottom: 7px; }
.rmg-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.rmg-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.rmg-module-card { padding: 18px; }
.rmg-module-card h3 { margin: 0 0 8px; font-size: 15px; }
.rmg-module-card p { margin: 0; color: var(--rmg-muted); line-height: 1.6; }
.rmg-inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.rmg-inline-form .rmg-field { margin: 0; flex: 1 1 160px; }

.rmg-modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(4,20,44,.56); backdrop-filter: blur(5px); }
.rmg-modal { width: min(100%, 600px); max-height: min(90vh, 760px); overflow: auto; background: #fff; border-radius: 20px; box-shadow: 0 34px 80px rgba(0,0,0,.22); }
.rmg-modal-head { padding: 20px 22px; border-bottom: 1px solid var(--rmg-border); display: flex; justify-content: space-between; align-items: center; }
.rmg-modal-head h3 { margin: 0; font-size: 19px; }
.rmg-modal-body { padding: 22px; }
.rmg-modal-foot { padding: 16px 22px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--rmg-border); }
.rmg-close { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; color: var(--rmg-muted); }
.rmg-close:hover { background: #f1f5fa; }

.rmg-alert { padding: 12px 14px; border-radius: 11px; margin-bottom: 14px; line-height: 1.5; }
.rmg-alert-error { color: #9d262c; background: #fdebed; border: 1px solid #f5cdd0; }
.rmg-alert-success { color: #08734d; background: #e7f8f0; border: 1px solid #c7eddc; }
.rmg-toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; }
.rmg-toast { min-width: 280px; max-width: 420px; padding: 13px 15px; border-radius: 12px; background: var(--rmg-primary); color: #fff; box-shadow: 0 16px 38px rgba(0,0,0,.2); animation: rmgToast .25s ease-out; }
.rmg-toast.is-error { background: #a92e35; }
@keyframes rmgToast { from { transform: translateY(10px); opacity: 0; } }

.rmg-mobile-overlay { display: none; }

@media (max-width: 1280px) {
    .rmg-dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); }
    .rmg-dashboard-grid > .rmg-card:nth-child(3) { grid-column: span 2; }
    .rmg-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .rmg-quick-grid { grid-template-columns: repeat(3, minmax(130px,1fr)); }
}

@media (max-width: 980px) {
    :root { --rmg-sidebar-width: 230px; }
    .rmg-sidebar { transform: translateX(-105%); }
    .rmg-sidebar.is-open { transform: translateX(0); }
    .rmg-main { margin-left: 0; }
    .rmg-menu-toggle { display: grid; }
    .rmg-mobile-overlay { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(3,20,43,.42); opacity: 0; visibility: hidden; transition: .2s; }
    .rmg-mobile-overlay.is-open { opacity: 1; visibility: visible; }
    .rmg-topbar-title { min-width: 0; }
    .rmg-search { display: none; }
    .rmg-dashboard-grid { grid-template-columns: 1fr; }
    .rmg-dashboard-grid .rmg-span-2, .rmg-dashboard-grid > .rmg-card:nth-child(3) { grid-column: auto; }
}

@media (max-width: 760px) {
    .rmg-auth-card { grid-template-columns: 1fr; min-height: auto; }
    .rmg-auth-brand { padding: 28px; min-height: 290px; }
    .rmg-auth-feature-list { display: none; }
    .rmg-auth-form-wrap { padding: 34px 24px; }
    .rmg-content { padding: 18px 15px 28px; }
    .rmg-topbar { height: 68px; padding: 0 15px; }
    .rmg-topbar-title p, .rmg-user-copy { display: none; }
    .rmg-topbar-title h1 { font-size: 20px; }
    .rmg-metric-grid { grid-template-columns: 1fr; }
    .rmg-metric-card { grid-template-columns: 50px 1fr auto; }
    .rmg-page-head { align-items: flex-start; flex-direction: column; }
    .rmg-grid-2, .rmg-grid-3, .rmg-field-row { grid-template-columns: 1fr; }
    .rmg-quick-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .rmg-top-actions .rmg-icon-btn:not(.rmg-menu-toggle) { display: none; }
    .rmg-user-menu { padding-left: 0; }
    .rmg-page-actions { justify-content: stretch; }
    .rmg-page-actions .rmg-btn { flex: 1; }
    .rmg-quick-grid { grid-template-columns: 1fr; }
    .rmg-metric-card { grid-template-columns: 48px 1fr; }
    .rmg-sparkline { display: none; }
}

/* ========================================================================== 
   RMG Business Platform v0.4.2 — Enterprise SaaS Dashboard System
   ========================================================================== */
:root {
    --rmg-bg: #f6f8fc;
    --rmg-card: #ffffff;
    --rmg-border: #e3e9f2;
    --rmg-text: #0a1b44;
    --rmg-muted: #6b7894;
    --rmg-success: #08a36a;
    --rmg-danger: #e34c57;
    --rmg-shadow: 0 8px 24px rgba(21, 49, 91, .055);
    --rmg-shadow-hover: 0 16px 34px rgba(21, 49, 91, .09);
    --rmg-sidebar-width: 238px;
    --rmg-topbar-height: 92px;
    font-family: Inter, "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body.rmg-app-page {
    background: var(--rmg-bg);
    color: var(--rmg-text);
    font-size: 14px;
    letter-spacing: -.005em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.rmg-sidebar {
    width: var(--rmg-sidebar-width);
    padding: 21px 16px 17px;
    background:
        radial-gradient(circle at 48% -5%, rgba(41, 101, 255, .2), transparent 28%),
        linear-gradient(180deg, #061940 0%, #082b62 58%, #071d47 100%);
    box-shadow: 10px 0 30px rgba(4, 20, 52, .08);
}
.rmg-sidebar .rmg-brand-lockup {
    min-height: 72px;
    padding: 0 4px 17px;
    gap: 13px;
}
.rmg-sidebar .rmg-logo-mark {
    width: 64px;
    height: 52px;
    border: 3px solid rgba(255,255,255,.96);
    border-radius: 13px;
    background: rgba(255,255,255,.035);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
    font-size: 18px;
    letter-spacing: -1.5px;
}
.rmg-sidebar .rmg-brand-copy strong {
    font-size: 12px;
    line-height: 1.28;
    letter-spacing: .015em;
}
.rmg-sidebar .rmg-brand-copy span {
    margin-top: 2px;
    font-size: 11px;
    color: rgba(255,255,255,.76);
}
.rmg-nav-section-label {
    margin: 15px 10px 7px;
    color: rgba(255,255,255,.48);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .12em;
}
.rmg-nav-system-label { margin-top: 22px; }
.rmg-nav {
    gap: 4px;
    padding: 0;
    overflow: visible;
}
.rmg-nav-system { margin-bottom: 2px; }
.rmg-nav-item {
    min-height: 45px;
    padding: 0 12px;
    border-radius: 10px;
    gap: 12px;
    color: rgba(255,255,255,.84);
    font-size: 12px;
    font-weight: 600;
}
.rmg-nav-item:hover {
    background: rgba(255,255,255,.075);
    transform: none;
}
.rmg-nav-item.is-active {
    background: linear-gradient(100deg, #1764eb 0%, #166eff 100%);
    box-shadow: 0 8px 20px rgba(19, 92, 237, .26), inset 0 1px 0 rgba(255,255,255,.16);
}
.rmg-nav-icon { width: 19px; height: 19px; }
.rmg-nav-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #2d74ff;
    border: 1px solid rgba(255,255,255,.28);
    font-size: 9px;
}
.rmg-sidebar-footer { padding-top: 18px; }
.rmg-version-card {
    border-radius: 12px;
    padding: 14px 15px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.045);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.rmg-version-card strong { font-size: 12px; }
.rmg-version-card small { display: block; margin-top: 4px; font-size: 10px; }
.rmg-health { margin-top: 11px; font-size: 10px; font-weight: 600; }
.rmg-sidebar-legal {
    margin: 54px 4px 12px;
    color: rgba(255,255,255,.58);
    font-size: 9px;
    line-height: 1.65;
}
.rmg-sidebar-legal span { color: rgba(255,255,255,.42); }
.rmg-sidebar-collapse {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,.76);
    font-size: 19px;
    line-height: 1;
}

.rmg-main { margin-left: var(--rmg-sidebar-width); background: var(--rmg-bg); }
.rmg-topbar {
    height: var(--rmg-topbar-height);
    gap: 20px;
    padding: 0 26px;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid #e7ecf3;
    backdrop-filter: blur(18px);
}
.rmg-topbar-title { min-width: 330px; }
.rmg-topbar-title h1 {
    margin: 0;
    color: #0a1b44;
    font-size: 27px;
    line-height: 1.08;
    font-weight: 780;
    letter-spacing: -.045em;
}
.rmg-topbar-title p {
    margin: 8px 0 0;
    color: #6f7c97;
    font-size: 11px;
    line-height: 1.2;
}
.rmg-search {
    position: relative;
    max-width: 405px;
    min-width: 210px;
    flex: 1 1 320px;
}
.rmg-search .rmg-input {
    height: 47px;
    padding: 0 58px 0 42px;
    border-color: #dce4ee;
    border-radius: 11px;
    box-shadow: 0 2px 7px rgba(24,51,88,.025);
    color: #20345d;
    font-size: 12px;
}
.rmg-search > svg { top: 14px; left: 14px; width: 18px; }
.rmg-search kbd {
    position: absolute;
    top: 12px;
    right: 12px;
    min-width: 34px;
    height: 23px;
    padding: 0 6px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: #f4f6fa;
    color: #7b879d;
    font: 600 9px/1 inherit;
    box-shadow: inset 0 0 0 1px #edf0f5;
}
.rmg-top-actions { gap: 9px; }
.rmg-icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #dfe6ef;
    background: #fff;
    color: #0b2857;
    box-shadow: 0 2px 6px rgba(24, 49, 83, .025);
    transition: border-color .18s, box-shadow .18s, transform .18s, background .18s;
}
.rmg-icon-btn:hover {
    transform: translateY(-1px);
    border-color: #cdd9e9;
    box-shadow: 0 7px 16px rgba(26,54,93,.08);
}
.rmg-notification-button { position: relative; }
.rmg-notification-count {
    position: absolute;
    top: -5px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #175ff0;
    color: #fff;
    font-size: 8px;
    font-weight: 800;
}
.rmg-top-divider { width: 1px; height: 36px; background: #e4e9f1; margin: 0 2px; }
.rmg-user-menu { min-width: 0; max-width: 255px; padding-left: 3px; gap: 10px; }
.rmg-avatar {
    width: 42px;
    height: 42px;
    background: #071c48;
    font-size: 11px;
    box-shadow: 0 4px 12px rgba(7,28,72,.12);
}
.rmg-user-copy { min-width: 0; }
.rmg-user-copy strong {
    max-width: 175px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 750;
}
.rmg-user-copy span { margin-top: 3px; font-size: 9px; text-transform: lowercase; }
.rmg-user-chevron { width: 17px; color: #0c2753; display: grid; place-items: center; }
.rmg-user-chevron svg { width: 14px; height: 14px; }
.rmg-logout-button { margin-left: 0; }

.rmg-content {
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    padding: 20px 26px 36px;
}
.rmg-dashboard-toolbar {
    min-height: 48px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.rmg-date-filter {
    height: 41px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid #dce4ee;
    border-radius: 9px;
    background: #fff;
    color: #24375f;
    box-shadow: 0 2px 6px rgba(21,49,91,.025);
    font-weight: 600;
    font-size: 11px;
}
.rmg-date-filter svg { width: 16px; height: 16px; color: #0f3168; }
.rmg-date-filter svg:last-child { width: 13px; }
.rmg-dashboard-actions { display: flex; gap: 10px; }
.rmg-dashboard-actions .rmg-btn {
    height: 42px;
    padding: 0 16px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
}
.rmg-export-button { color: #0a234d; }
.rmg-new-order-button {
    min-width: 142px;
    background: linear-gradient(135deg, #135cf0, #166fff);
    box-shadow: 0 8px 18px rgba(22,103,255,.2);
}
.rmg-dashboard-actions svg { width: 17px; height: 17px; }
.rmg-button-caret { margin-left: 8px; opacity: .75; }

.rmg-card {
    border: 1px solid #e1e7ef;
    border-radius: 12px;
    box-shadow: var(--rmg-shadow);
}
.rmg-card:hover { box-shadow: var(--rmg-shadow-hover); }
.rmg-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.rmg-metric-card {
    min-height: 142px;
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: relative;
    overflow: hidden;
    animation: rmgDashboardIn .42s ease both;
}
.rmg-metric-card:nth-child(2) { animation-delay: .04s; }
.rmg-metric-card:nth-child(3) { animation-delay: .08s; }
.rmg-metric-card:nth-child(4) { animation-delay: .12s; }
.rmg-metric-head { display: flex; align-items: center; gap: 12px; }
.rmg-metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 11px;
    flex: 0 0 auto;
    background: linear-gradient(145deg, #174fd7, #176eff);
    box-shadow: 0 8px 16px rgba(21,94,232,.2), inset 0 1px 0 rgba(255,255,255,.16);
}
.rmg-metric-icon svg { width: 23px; height: 23px; }
.rmg-metric-label {
    color: #304265;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
}
.rmg-metric-value {
    display: block;
    margin: -20px 0 0 61px;
    color: #091b43;
    font-size: 23px;
    line-height: 1.05;
    font-weight: 790;
    letter-spacing: -.045em;
}
.rmg-metric-foot {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 9px;
}
.rmg-trend { margin: 0; font-size: 9px; line-height: 1.2; }
.rmg-trend b { display: block; color: #08a36a; font-size: 9px; }
.rmg-trend.is-negative b { color: #d84a54; }
.rmg-trend span { display: block; margin-top: 4px; color: #7b879d; font-weight: 500; }
.rmg-sparkline { width: 84px; height: 38px; flex: 0 0 auto; }
.rmg-sparkline path { stroke: #1769ff; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

.rmg-dashboard-primary {
    margin-top: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(286px, 1fr) minmax(238px, .88fr);
    gap: 14px;
    align-items: stretch;
}
.rmg-dashboard-primary > .rmg-card,
.rmg-dashboard-lower > .rmg-card { animation: rmgDashboardIn .42s ease both; }
.rmg-dashboard-primary > .rmg-card:nth-child(2) { animation-delay: .04s; }
.rmg-dashboard-primary > .rmg-card:nth-child(3) { animation-delay: .08s; }
.rmg-panel { padding: 15px; }
.rmg-panel-head { margin-bottom: 14px; }
.rmg-panel-title h2 {
    color: #0a1b44;
    font-size: 13px;
    font-weight: 760;
    letter-spacing: -.025em;
}
.rmg-count-pill {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #1a65f3;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
}
.rmg-link { color: #0f5de8; font-size: 9px; font-weight: 700; }
.rmg-link:hover { color: #0647be; }
.rmg-period-select {
    width: auto !important;
    min-width: 106px;
    height: 34px !important;
    padding: 0 30px 0 10px !important;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 600;
}
.rmg-chart-legend { gap: 16px; margin: 0 0 4px; font-size: 9px; }
.rmg-legend-dot { width: 7px; height: 7px; }
.rmg-legend-dot.orders { background: #1769ff; }
.rmg-legend-dot.revenue { background: #8d78f2; }
.rmg-chart-wrap { height: 242px; }
.rmg-chart-grid-line { stroke: #e8edf4; stroke-dasharray: 3 3; }
.rmg-chart-axis { fill: #8190aa; font-size: 8px; }
.rmg-chart-line { stroke: url(#rmgRevenueLine); stroke-width: 2.1; }
.rmg-chart-point { stroke: #6f63dd; stroke-width: 1.7; }
.rmg-chart-bar { opacity: .94; rx: 2.5; }
.rmg-dashboard-chart-panel { min-height: 320px; }

.rmg-dashboard-approval-panel,
.rmg-dashboard-activity-panel { min-height: 320px; }
.rmg-approval-list, .rmg-activity-list { gap: 0; }
.rmg-approval-item {
    min-height: 54px;
    grid-template-columns: 34px minmax(0,1fr) auto;
    gap: 8px;
    padding: 8px 0;
    border-bottom-color: #edf1f6;
}
.rmg-mini-avatar {
    width: 30px;
    height: 30px;
    background: #eef4ff;
    color: #1766ef;
    font-size: 9px;
}
.rmg-item-copy { min-width: 0; }
.rmg-item-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #14264b;
    font-size: 9px;
    font-weight: 700;
}
.rmg-item-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
    color: #7c89a1;
    font-size: 7.5px;
}
.rmg-approval-actions { gap: 5px; }
.rmg-dashboard-approval-panel .rmg-btn-sm {
    height: 31px;
    padding: 0 9px;
    border-radius: 7px;
    font-size: 8px;
    font-weight: 700;
}
.rmg-dashboard-approval-panel .rmg-btn-dark {
    background: #071e4a;
    box-shadow: none;
}
.rmg-dashboard-approval-panel .rmg-btn-light {
    color: #da3b48;
    border-color: #f0b5ba;
}
.rmg-dashboard-approval-panel .rmg-btn-light:hover { background: #fff7f8; }
.rmg-activity-item {
    min-height: 53px;
    grid-template-columns: 32px minmax(0,1fr) auto;
    padding: 8px 0;
}
.rmg-activity-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #f1f5ff;
    color: #1768f7;
}
.rmg-time { font-size: 7.5px; }
.rmg-live-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #23a56f;
    font-size: 9px;
    font-weight: 600;
}
.rmg-live-label i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3cd28e;
    box-shadow: 0 0 0 4px #e5f8ef;
}
.rmg-panel-footer-link {
    margin-top: 11px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.rmg-panel-footer-link svg { width: 11px; height: 11px; }

.rmg-dashboard-lower {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 14px;
    align-items: stretch;
}
.rmg-dashboard-lower > .rmg-card { min-height: 215px; }
.rmg-dashboard-lower > .rmg-card:nth-child(2) { animation-delay: .04s; }
.rmg-dashboard-lower > .rmg-card:nth-child(3) { animation-delay: .08s; }
.rmg-dashboard-lower > .rmg-card:nth-child(4) { animation-delay: .12s; }
.rmg-dashboard-list { display: grid; }
.rmg-dashboard-order,
.rmg-dashboard-simple-row,
.rmg-dashboard-notification-row {
    min-height: 42px;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #edf1f6;
}
.rmg-dashboard-order:last-child,
.rmg-dashboard-simple-row:last-child,
.rmg-dashboard-notification-row:last-child { border-bottom: 0; }
.rmg-dashboard-order > div { min-width: 0; }
.rmg-dashboard-order-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rmg-dashboard-order strong,
.rmg-dashboard-simple-row strong,
.rmg-dashboard-notification-row strong {
    color: #15284e;
    font-size: 8.5px;
    font-weight: 700;
}
.rmg-dashboard-order > div > span {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #7c89a1;
    font-size: 7.5px;
}
.rmg-dashboard-order > b,
.rmg-dashboard-simple-row > span { color: #16264a; font-size: 8.5px; font-weight: 700; white-space: nowrap; }
.rmg-new-pill {
    padding: 3px 6px;
    border-radius: 999px;
    background: #e8f0ff;
    color: #1768f7 !important;
    font-size: 7px !important;
    font-weight: 700;
}
.rmg-dashboard-fee-row {
    min-height: 42px;
    padding: 7px 0;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid #edf1f6;
}
.rmg-dashboard-fee-row:last-child { border-bottom: 0; }
.rmg-dashboard-fee-row > div { min-width: 0; display: flex; align-items: center; gap: 6px; }
.rmg-dashboard-fee-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #17294e;
    font-size: 8px;
    font-weight: 650;
}
.rmg-dashboard-fee-row b { font-size: 8px; white-space: nowrap; }
.rmg-state-mark {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 5px;
    background: #f2f5fa;
    color: #75839c;
    font-size: 6px;
    font-weight: 800;
}
.rmg-dashboard-fee-row .rmg-status {
    min-width: 44px;
    padding: 3px 6px;
    font-size: 7px;
}
.rmg-dashboard-notification-row > span {
    font-size: 8px;
    font-weight: 650;
    white-space: nowrap;
}
.rmg-dashboard-notification-row > span.is-enabled { color: #11a06b; }
.rmg-dashboard-notification-row > span.is-disabled { color: #a1a9b7; }
.rmg-dashboard-master-toggle {
    width: 31px;
    height: 18px;
    padding: 2px;
    display: flex;
    justify-content: flex-end;
    border-radius: 999px;
    background: #1768f7;
}
.rmg-dashboard-master-toggle i { width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.rmg-dashboard-empty {
    min-height: 120px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    color: #7b879d;
}
.rmg-dashboard-empty strong { display: block; color: #17284d; font-size: 10px; }
.rmg-dashboard-empty span { margin-top: 4px; font-size: 8px; }

@keyframes rmgDashboardIn {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1370px) {
    .rmg-topbar { padding-left: 22px; padding-right: 22px; gap: 14px; }
    .rmg-topbar-title { min-width: 306px; }
    .rmg-topbar-title h1 { font-size: 25px; }
    .rmg-search { max-width: 330px; }
    .rmg-content { padding-left: 22px; padding-right: 22px; }
    .rmg-dashboard-primary { grid-template-columns: minmax(0,1.55fr) minmax(275px,1fr) minmax(225px,.84fr); }
    .rmg-dashboard-approval-panel .rmg-btn-sm { padding: 0 7px; }
    .rmg-dashboard-lower { gap: 12px; }
}

@media (max-width: 1180px) {
    .rmg-topbar-title { min-width: 260px; }
    .rmg-topbar-title h1 { font-size: 23px; }
    .rmg-user-copy { display: none; }
    .rmg-user-menu { max-width: none; }
    .rmg-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .rmg-dashboard-primary { grid-template-columns: minmax(0,1.45fr) minmax(300px,.95fr); }
    .rmg-dashboard-activity-panel { grid-column: 1 / -1; min-height: auto; }
    .rmg-dashboard-activity-panel .rmg-activity-list { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 18px; }
    .rmg-dashboard-lower { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 980px) {
    :root { --rmg-sidebar-width: 238px; }
    .rmg-topbar { height: 80px; }
    .rmg-topbar-title { min-width: 0; }
    .rmg-topbar-title h1 { font-size: 22px; }
    .rmg-dashboard-primary { grid-template-columns: 1fr; }
    .rmg-dashboard-activity-panel { grid-column: auto; }
    .rmg-dashboard-activity-panel .rmg-activity-list { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .rmg-topbar { height: 72px; padding: 0 14px; gap: 10px; }
    .rmg-topbar-title h1 { font-size: 19px; }
    .rmg-top-actions { margin-left: auto; }
    .rmg-top-divider, .rmg-user-chevron, .rmg-logout-button { display: none; }
    .rmg-content { padding: 15px 14px 28px; }
    .rmg-dashboard-toolbar { align-items: stretch; flex-direction: column; }
    .rmg-date-filter { align-self: flex-start; }
    .rmg-dashboard-actions { width: 100%; }
    .rmg-dashboard-actions .rmg-btn { flex: 1; }
    .rmg-metric-grid, .rmg-dashboard-lower { grid-template-columns: 1fr; }
    .rmg-metric-card { min-height: 132px; }
    .rmg-dashboard-chart-panel { overflow: hidden; }
    .rmg-chart-wrap { overflow-x: auto; }
    .rmg-chart-wrap svg { min-width: 650px; }
}

@media (max-width: 480px) {
    .rmg-topbar-title p { display: none; }
    .rmg-topbar-title h1 { max-width: 205px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rmg-dashboard-actions { flex-direction: column; }
    .rmg-dashboard-actions .rmg-btn { width: 100%; }
    .rmg-date-filter { width: 100%; justify-content: center; }
    .rmg-metric-value { font-size: 22px; }
    .rmg-sparkline { display: block; width: 78px; }
    .rmg-approval-item { grid-template-columns: 30px minmax(0,1fr); }
    .rmg-approval-actions { grid-column: 2; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .rmg-metric-card,
    .rmg-dashboard-primary > .rmg-card,
    .rmg-dashboard-lower > .rmg-card { animation: none !important; }
}

/* ========================================================================== 
   RMG Business Platform v0.6.0 — exact dashboard design system
   ========================================================================== */
:root {
    --rmg-font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --rmg-base-font-size: 14px;
    --rmg-page-title-size: 30px;
    --rmg-section-title-size: 14px;
    --rmg-nav-font-size: 14px;
    --rmg-metric-value-size: 27px;
    --rmg-sidebar-width: 280px;
    --rmg-topbar-height: 102px;
    --rmg-bg: #f8fafd;
    --rmg-card: #ffffff;
    --rmg-border: #e3e9f2;
    --rmg-text: #0b1f47;
    --rmg-muted: #72809a;
    --rmg-success: #12a66a;
    --rmg-radius: 12px;
    --rmg-shadow: 0 5px 18px rgba(26, 54, 93, .045);
    --rmg-shadow-hover: 0 10px 28px rgba(26, 54, 93, .08);
}

html, body, body.rmg-app-page,
button, input, select, textarea { font-family: var(--rmg-font-family); }
body.rmg-app-page {
    font-size: var(--rmg-base-font-size);
    background: var(--rmg-bg);
    color: var(--rmg-text);
    letter-spacing: -.008em;
}

/* Sidebar */
.rmg-sidebar {
    width: var(--rmg-sidebar-width);
    padding: 21px 18px 16px;
    background: linear-gradient(180deg, var(--rmg-sidebar-start) 0%, #07326f 58%, var(--rmg-sidebar-end) 100%);
    box-shadow: none;
}
.rmg-sidebar .rmg-brand-lockup {
    min-height: 82px;
    padding: 0 4px 24px;
    gap: 14px;
}
.rmg-sidebar .rmg-logo-mark {
    width: 72px;
    height: 66px;
    border: 4px solid rgba(255,255,255,.96);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -1.8px;
}
.rmg-sidebar .rmg-brand-copy strong {
    max-width: 120px;
    color: #fff;
    font-size: 15px;
    line-height: 1.22;
    font-weight: 800;
    letter-spacing: -.01em;
}
.rmg-sidebar .rmg-brand-copy span {
    margin-top: 2px;
    color: rgba(255,255,255,.83);
    font-size: 14px;
    line-height: 1.2;
}
.rmg-nav-section-label {
    margin: 18px 9px 8px;
    color: rgba(255,255,255,.62);
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: .03em;
}
.rmg-nav-system-label { margin-top: 28px; }
.rmg-nav { gap: 4px; }
.rmg-nav-item {
    min-height: 49px;
    padding: 0 14px;
    border-radius: 10px;
    gap: 13px;
    color: rgba(255,255,255,.94);
    font-size: var(--rmg-nav-font-size);
    font-weight: 600;
    letter-spacing: -.012em;
}
.rmg-nav-item:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}
.rmg-nav-item.is-active {
    background: linear-gradient(100deg, #0b61ee 0%, #1667f7 100%);
    box-shadow: 0 8px 18px rgba(0, 67, 186, .20), inset 0 1px 0 rgba(255,255,255,.13);
}
.rmg-nav-icon { width: 23px; height: 23px; }
.rmg-nav-icon svg { width: 23px; height: 23px; }
.rmg-nav-badge {
    min-width: 21px;
    height: 21px;
    border: 1px solid rgba(255,255,255,.26);
    background: #216fff;
    font-size: 10px;
}
.rmg-sidebar-footer { margin-top: auto; padding-top: 16px; }
.rmg-version-card {
    padding: 18px 18px 17px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 11px;
    background: rgba(255,255,255,.035);
    box-shadow: none;
}
.rmg-version-card strong { font-size: 15px; font-weight: 800; }
.rmg-version-card small { margin-top: 6px; color: rgba(255,255,255,.8); font-size: 12px; }
.rmg-health { margin-top: 17px; color: #77e2aa; font-size: 11px; font-weight: 600; }
.rmg-health-dot { width: 8px; height: 8px; background: #36d68b; box-shadow: 0 0 0 4px rgba(54,214,139,.12); }
.rmg-sidebar-legal {
    margin: 63px 3px 21px;
    color: rgba(255,255,255,.68);
    font-size: 10px;
    line-height: 1.6;
}
.rmg-sidebar-legal span { color: rgba(255,255,255,.54); }
.rmg-sidebar-collapse { margin-left: -2px; color: rgba(255,255,255,.83); }

/* Main/header */
.rmg-main { margin-left: var(--rmg-sidebar-width); min-width: 0; background: var(--rmg-bg); }
.rmg-topbar {
    height: var(--rmg-topbar-height);
    position: sticky;
    top: 0;
    padding: 0 29px;
    gap: 22px;
    background: rgba(255,255,255,.98);
    border-bottom: 0;
    box-shadow: 0 1px 0 rgba(224,231,241,.78);
    backdrop-filter: blur(18px);
}
.rmg-topbar-title {
    min-width: 0;
    flex: 1 1 430px;
    max-width: 465px;
}
.rmg-topbar-title h1 {
    color: var(--rmg-text);
    font-size: var(--rmg-page-title-size);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -.045em;
}
.rmg-topbar-title p {
    margin: 9px 0 0;
    color: var(--rmg-muted);
    font-size: 12px;
    line-height: 1.25;
    font-weight: 450;
}
.rmg-search {
    max-width: 405px;
    min-width: 320px;
    flex: 0 1 405px;
}
.rmg-search .rmg-input {
    height: 49px;
    padding: 0 59px 0 46px;
    border: 1px solid #dfe5ed;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
    color: #273b61;
    font-size: 12px;
}
.rmg-search > svg { left: 15px; top: 15px; width: 19px; height: 19px; color: #8190aa; }
.rmg-search kbd { top: 13px; right: 13px; background: #f6f7fa; color: #8b95a7; }
.rmg-top-actions { position: relative; margin-left: auto; gap: 11px; }
.rmg-icon-btn {
    width: 43px;
    height: 43px;
    border: 1px solid #e0e6ee;
    background: #fff;
    color: #0b2857;
    box-shadow: none;
}
.rmg-icon-btn:hover { transform: none; border-color: #cfd9e7; box-shadow: 0 5px 14px rgba(20,43,74,.06); }
.rmg-top-divider { height: 40px; margin: 0 4px; background: #e2e7ef; }
.rmg-avatar { width: 45px; height: 45px; background: #071d49; font-size: 12px; font-weight: 800; box-shadow: none; }
.rmg-user-menu {
    appearance: none;
    border: 0;
    background: transparent;
    max-width: 260px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--rmg-text);
    text-align: left;
}
.rmg-user-copy strong { max-width: 180px; color: #0b1f47; font-size: 10px; font-weight: 750; }
.rmg-user-copy span { color: #7b879d; font-size: 9px; }
.rmg-user-chevron { margin-left: 2px; }
.rmg-profile-popover {
    position: absolute;
    z-index: 80;
    top: 57px;
    right: 0;
    width: 280px;
    padding: 8px;
    border: 1px solid var(--rmg-border);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15,38,72,.16);
}
.rmg-profile-popover[hidden] { display: none !important; }
.rmg-profile-popover a,
.rmg-profile-popover button {
    width: 100%;
    min-height: 58px;
    padding: 10px 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 10px;
    color: var(--rmg-text);
    text-align: left;
}
.rmg-profile-popover a:hover,
.rmg-profile-popover button:hover { background: #f5f8fd; }
.rmg-profile-popover svg { width: 19px; height: 19px; color: #1768f7; }
.rmg-profile-popover strong { display: block; font-size: 11px; }
.rmg-profile-popover small { display: block; margin-top: 3px; color: var(--rmg-muted); font-size: 9px; }

/* Dashboard structure */
.rmg-content {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 12px 29px 30px;
}
.rmg-dashboard-toolbar {
    min-height: 52px;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rmg-date-filter {
    min-width: 215px;
    height: 44px;
    padding: 0 15px;
    border: 1px solid #e0e6ee;
    border-radius: 9px;
    background: #fff;
    color: #17315d;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 7px rgba(20,43,74,.02);
}
.rmg-date-filter svg { width: 17px; height: 17px; }
.rmg-dashboard-actions { display: flex; align-items: center; gap: 15px; }
.rmg-dashboard-actions .rmg-btn {
    height: 44px;
    min-width: 144px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 750;
}
.rmg-export-button { color: #0d2856; border-color: #dfe5ed; background: #fff; box-shadow: none; }
.rmg-new-order-button { min-width: 166px !important; background: linear-gradient(105deg, #0b61ef, #125cf2); box-shadow: none; }
.rmg-dashboard-actions svg { width: 18px; height: 18px; }
.rmg-button-caret { margin-left: auto; font-size: 14px; }

.rmg-card {
    background: var(--rmg-card);
    border: 1px solid var(--rmg-border);
    border-radius: var(--rmg-radius);
    box-shadow: var(--rmg-shadow);
}
.rmg-card:hover { transform: none; box-shadow: var(--rmg-shadow-hover); }
.rmg-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 16px;
}
.rmg-metric-card {
    min-height: 154px;
    padding: 24px 22px 18px;
    display: grid;
    grid-template-columns: 58px minmax(0,1fr) 104px;
    grid-template-rows: auto auto 1fr;
    column-gap: 16px;
    row-gap: 3px;
    align-items: start;
}
.rmg-metric-head { display: contents; }
.rmg-metric-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(145deg, #0755dc, #126cf8);
    box-shadow: 0 7px 17px rgba(22,104,247,.15);
}
.rmg-metric-icon svg { width: 27px; height: 27px; }
.rmg-metric-label {
    grid-column: 2;
    grid-row: 1;
    margin-top: 3px;
    color: #22375f;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.rmg-metric-value {
    grid-column: 2;
    grid-row: 2;
    color: #0a1c46;
    font-size: var(--rmg-metric-value-size);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -.035em;
}
.rmg-metric-foot { display: contents; }
.rmg-trend {
    grid-column: 1 / span 2;
    grid-row: 3;
    align-self: end;
    margin: 0;
    padding-left: 5px;
    color: var(--rmg-success);
    font-size: 10px;
    line-height: 1.25;
}
.rmg-trend b { display: block; font-weight: 700; }
.rmg-trend span { display: block; margin-top: 4px; color: #71809a; font-weight: 500; }
.rmg-sparkline {
    grid-column: 3;
    grid-row: 1 / span 3;
    align-self: center;
    width: 104px;
    height: 48px;
}
.rmg-sparkline path { stroke: #1768ff; stroke-width: 2; }

.rmg-dashboard-primary {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0,1.62fr) minmax(355px,1.2fr) minmax(300px,1fr);
    gap: 16px;
    align-items: stretch;
}
.rmg-dashboard-primary > .rmg-card { min-width: 0; }
.rmg-panel { padding: 17px 16px 15px; }
.rmg-panel-head { margin-bottom: 13px; }
.rmg-panel-title h2 {
    color: #0b1f47;
    font-size: var(--rmg-section-title-size);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.025em;
}
.rmg-link { color: #075fe9; font-size: 10px; font-weight: 700; }
.rmg-count-pill { min-width: 21px; height: 21px; background: #1768f7; font-size: 9px; }
.rmg-period-select {
    min-width: 117px;
    height: 36px !important;
    padding: 0 31px 0 12px !important;
    border-radius: 8px;
    font-size: 10px;
}
.rmg-chart-legend { margin-bottom: 4px; font-size: 9px; }
.rmg-chart-wrap { height: 226px; }
.rmg-dashboard-chart-panel,
.rmg-dashboard-approval-panel,
.rmg-dashboard-activity-panel { min-height: 315px; }
.rmg-dashboard-chart-panel { overflow: hidden; }
.rmg-chart-grid-line { stroke: #e7ebf1; stroke-dasharray: 3 3; }
.rmg-chart-axis { fill: #71809a; font-size: 8.5px; }
.rmg-chart-line { stroke: #1768f7; stroke-width: 1.9; }
.rmg-chart-point { stroke: #1768f7; }
.rmg-chart-bar { opacity: .96; }

.rmg-approval-item {
    min-height: 55px;
    grid-template-columns: 36px minmax(0,1fr) auto;
    gap: 10px;
    padding: 7px 0;
}
.rmg-mini-avatar { width: 32px; height: 32px; font-size: 9px; }
.rmg-item-copy strong { color: #0d224b; font-size: 9.5px; font-weight: 750; }
.rmg-item-copy span { margin-top: 3px; color: #76839b; font-size: 8px; }
.rmg-approval-actions { gap: 7px; }
.rmg-dashboard-approval-panel .rmg-btn-sm {
    min-width: 80px;
    height: 31px;
    padding: 0 9px;
    border-radius: 6px;
    font-size: 8px;
}
.rmg-dashboard-approval-panel .rmg-btn-dark { background: #071d48; }
.rmg-dashboard-approval-panel .rmg-btn-light { color: #d73945; border-color: #f1b1b8; }
.rmg-activity-item {
    min-height: 52px;
    grid-template-columns: 33px minmax(0,1fr) auto;
    gap: 10px;
    padding: 8px 0;
}
.rmg-activity-icon { width: 31px; height: 31px; border-radius: 8px; background: #f0f5ff; }
.rmg-time { color: #71809a; font-size: 8px; }
.rmg-live-label { color: #27a672; font-size: 9px; }
.rmg-live-label i { width: 7px; height: 7px; }
.rmg-panel-footer-link { margin-top: 8px; }

.rmg-dashboard-lower {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 16px;
}
.rmg-dashboard-lower > .rmg-card { min-height: 226px; }
.rmg-dashboard-order,
.rmg-dashboard-simple-row,
.rmg-dashboard-notification-row { min-height: 43px; padding: 7px 0; }
.rmg-dashboard-order strong,
.rmg-dashboard-simple-row strong,
.rmg-dashboard-notification-row strong { color: #10254d; font-size: 8.7px; }
.rmg-dashboard-order > div > span { color: #78859d; font-size: 7.7px; }
.rmg-dashboard-order > b,
.rmg-dashboard-simple-row > span { color: #0f234b; font-size: 8.6px; }
.rmg-new-pill { background: #e9f0ff; color: #1768f7 !important; font-size: 7px !important; }
.rmg-dashboard-fee-row { min-height: 43px; padding: 7px 0; }
.rmg-dashboard-fee-row strong { color: #14284f; font-size: 8.2px; }
.rmg-dashboard-fee-row b { font-size: 8.2px; }
.rmg-state-mark { width: 20px; height: 20px; }
.rmg-dashboard-master-toggle { width: 31px; height: 18px; background: #1768f7; }

/* Interface settings */
.rmg-interface-settings { width: 100%; }
.rmg-interface-settings-head {
    margin-bottom: 18px;
    padding: 2px 2px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 22px;
}
.rmg-settings-eyebrow { color: #1768f7; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.rmg-interface-settings-head h2 { margin: 5px 0 0; color: var(--rmg-text); font-size: 25px; letter-spacing: -.035em; }
.rmg-interface-settings-head p { margin: 6px 0 0; max-width: 720px; color: var(--rmg-muted); font-size: 11px; line-height: 1.55; }
.rmg-settings-actions { display: flex; gap: 9px; }
.rmg-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rmg-settings-panel { padding: 20px; }
.rmg-settings-panel-wide { grid-column: 1 / -1; }
.rmg-settings-panel-head { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.rmg-settings-panel-head > div { display: flex; align-items: center; gap: 10px; }
.rmg-settings-panel-head > div > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #edf4ff; color: #1768f7; font-size: 9px; font-weight: 800; }
.rmg-settings-panel-head h3 { margin: 0; color: var(--rmg-text); font-size: 14px; }
.rmg-settings-panel-head p { margin: 2px 0 0; max-width: 360px; color: var(--rmg-muted); font-size: 9px; text-align: right; }
.rmg-settings-color-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.rmg-settings-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 14px; }
.rmg-settings-panel .rmg-field { margin-bottom: 0; }
.rmg-settings-panel .rmg-field label { font-size: 10px; }
.rmg-settings-panel .rmg-input,
.rmg-settings-panel .rmg-select { height: 42px; border-radius: 9px; font-size: 10px; }
.rmg-settings-panel .rmg-color-input { height: 42px; border-radius: 9px; }
.rmg-settings-panel .rmg-color-input code { font-size: 9px; }
.rmg-number-control { position: relative; }
.rmg-number-control .rmg-input { padding-right: 40px; }
.rmg-number-control > span { position: absolute; right: 13px; top: 12px; color: #8a95a8; font-size: 9px; }
.rmg-navigation-settings-head p { max-width: 560px; }
.rmg-nav-editor { display: grid; gap: 7px; }
.rmg-nav-editor-row {
    min-height: 64px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: 24px 34px minmax(180px,1.3fr) minmax(120px,.8fr) 108px 92px 92px;
    align-items: center;
    gap: 9px;
    border: 1px solid #e5eaf1;
    border-radius: 10px;
    background: #fff;
}
.rmg-nav-editor-row.is-hidden { background: #f8fafc; opacity: .75; }
.rmg-nav-editor-drag { color: #9aa5b5; font-size: 15px; letter-spacing: -5px; cursor: grab; }
.rmg-nav-editor-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #edf4ff; color: #1768f7; }
.rmg-nav-editor-icon svg { width: 17px; height: 17px; }
.rmg-nav-editor-name .rmg-input { height: 34px; padding: 0 9px; }
.rmg-nav-editor-name span { display: block; margin-top: 3px; color: #8a95a8; font-size: 7px; }
.rmg-nav-editor-row > .rmg-select { height: 34px; padding: 0 27px 0 9px; }
.rmg-nav-visibility { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.rmg-nav-visibility input { display: none; }
.rmg-nav-visibility > span { position: relative; width: 31px; height: 18px; border-radius: 999px; background: #c9d2df; }
.rmg-nav-visibility > span::after { content: ""; position: absolute; width: 14px; height: 14px; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); transition: .2s; }
.rmg-nav-visibility input:checked + span { background: #1768f7; }
.rmg-nav-visibility input:checked + span::after { transform: translateX(13px); }
.rmg-nav-visibility b { color: #61718d; font-size: 8px; }
.rmg-nav-editor-actions { display: flex; justify-content: flex-end; gap: 5px; }
.rmg-nav-editor-actions button { width: 26px; height: 26px; border: 1px solid #dde4ed; border-radius: 7px; background: #fff; color: #40506a; }
.rmg-nav-editor-actions button:hover { background: #f5f8fc; }
.rmg-nav-editor-actions button.is-danger { color: #d73c49; border-color: #f0c3c8; }
.rmg-add-tab-box { margin-top: 15px; padding: 15px; border: 1px dashed #ced9e8; border-radius: 11px; background: #f8fbff; }
.rmg-add-tab-title { margin-bottom: 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rmg-add-tab-title strong { font-size: 11px; }
.rmg-add-tab-title span { color: var(--rmg-muted); font-size: 8px; }
.rmg-add-tab-grid { display: grid; grid-template-columns: 1.1fr 1.7fr .8fr .7fr auto; gap: 10px; align-items: end; }
.rmg-settings-footer-row { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rmg-settings-footer-row span { color: var(--rmg-muted); font-size: 8px; }

/* Responsive behavior while preserving the desktop composition. */
@media (max-width: 1450px) {
    :root { --rmg-sidebar-width: 252px; }
    .rmg-topbar { padding-left: 23px; padding-right: 23px; }
    .rmg-topbar-title { max-width: 390px; }
    .rmg-search { min-width: 260px; max-width: 360px; }
    .rmg-content { padding-left: 23px; padding-right: 23px; }
    .rmg-dashboard-primary { grid-template-columns: minmax(0,1.5fr) minmax(320px,1.05fr) minmax(270px,.9fr); }
    .rmg-metric-card { grid-template-columns: 54px minmax(0,1fr) 84px; padding-left: 18px; padding-right: 18px; }
    .rmg-sparkline { width: 84px; }
}
@media (max-width: 1220px) {
    .rmg-topbar-title { max-width: 330px; }
    .rmg-user-copy { display: none; }
    .rmg-search { min-width: 230px; }
    .rmg-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .rmg-dashboard-primary { grid-template-columns: minmax(0,1.35fr) minmax(340px,1fr); }
    .rmg-dashboard-activity-panel { grid-column: 1 / -1; min-height: auto; }
    .rmg-dashboard-activity-panel .rmg-activity-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 22px; }
    .rmg-dashboard-lower { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .rmg-nav-editor-row { grid-template-columns: 20px 32px minmax(160px,1.3fr) 105px 95px 84px 82px; }
}
@media (max-width: 980px) {
    :root { --rmg-sidebar-width: 238px; }
    .rmg-topbar { height: 84px; }
    .rmg-topbar-title h1 { font-size: min(var(--rmg-page-title-size), 24px); }
    .rmg-search { display: none; }
    .rmg-dashboard-primary { grid-template-columns: 1fr; }
    .rmg-dashboard-activity-panel { grid-column: auto; }
    .rmg-dashboard-activity-panel .rmg-activity-list { grid-template-columns: 1fr; }
    .rmg-settings-grid { grid-template-columns: 1fr; }
    .rmg-settings-panel-wide { grid-column: auto; }
    .rmg-settings-color-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .rmg-nav-editor-row { grid-template-columns: 22px 34px minmax(150px,1fr) 105px 88px 80px; }
    .rmg-nav-editor-actions { grid-column: 3 / -1; justify-content: flex-start; }
    .rmg-add-tab-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .rmg-add-tab-grid .rmg-btn { width: 100%; }
}
@media (max-width: 760px) {
    .rmg-sidebar { transform: translateX(-101%); box-shadow: 16px 0 38px rgba(7,28,72,.2); }
    .rmg-sidebar.is-open { transform: translateX(0); }
    .rmg-main { margin-left: 0; }
    .rmg-menu-toggle { display: grid; }
    .rmg-topbar { height: 76px; padding: 0 14px; }
    .rmg-topbar-title { flex: 1 1 auto; }
    .rmg-topbar-title p { display: none; }
    .rmg-top-actions .rmg-icon-btn:first-child, .rmg-top-divider { display: none; }
    .rmg-user-copy { display: none; }
    .rmg-content { padding: 14px; }
    .rmg-dashboard-toolbar { flex-direction: column; align-items: stretch; }
    .rmg-dashboard-actions { width: 100%; }
    .rmg-dashboard-actions .rmg-btn { flex: 1; }
    .rmg-date-filter { width: 100%; justify-content: center; }
    .rmg-metric-grid, .rmg-dashboard-lower { grid-template-columns: 1fr; }
    .rmg-metric-card { grid-template-columns: 56px minmax(0,1fr) 94px; }
    .rmg-dashboard-primary { grid-template-columns: 1fr; }
    .rmg-chart-wrap { overflow-x: auto; }
    .rmg-chart-wrap svg { min-width: 620px; }
    .rmg-interface-settings-head { align-items: stretch; flex-direction: column; }
    .rmg-settings-actions { width: 100%; }
    .rmg-settings-actions .rmg-btn { flex: 1; }
    .rmg-settings-color-grid, .rmg-settings-form-grid { grid-template-columns: 1fr; }
    .rmg-settings-panel-head { flex-direction: column; }
    .rmg-settings-panel-head p { text-align: left; }
    .rmg-nav-editor-row { grid-template-columns: 26px 36px minmax(0,1fr) 84px; }
    .rmg-nav-editor-row > .rmg-select[data-nav-icon], .rmg-nav-editor-row > .rmg-select[data-nav-group], .rmg-nav-visibility, .rmg-nav-editor-actions { grid-column: 3 / -1; }
    .rmg-add-tab-grid { grid-template-columns: 1fr; }
    .rmg-settings-footer-row { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
    .rmg-top-actions .rmg-notification-button { display: none; }
    .rmg-topbar-title h1 { max-width: 210px; font-size: 20px; }
    .rmg-dashboard-actions { flex-direction: column; }
    .rmg-dashboard-actions .rmg-btn { width: 100%; }
    .rmg-metric-card { grid-template-columns: 54px minmax(0,1fr); }
    .rmg-sparkline { display: none; }
    .rmg-settings-actions { flex-direction: column; }
    .rmg-settings-actions .rmg-btn { width: 100%; }
}

/* v0.6.0 — configurable settings + performance controls */
.rmg-sidebar-footer-minimal {
    margin-top: auto;
    padding: 14px 0 2px;
    min-height: 42px;
    display: flex;
    align-items: flex-end;
}
.rmg-sidebar-footer-minimal .rmg-sidebar-collapse { margin: 0; }

.rmg-settings-form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.rmg-field-span-2 { grid-column: span 2; }
.rmg-settings-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.rmg-settings-check-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rmg-settings-check {
    min-height: 68px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 13px;
    border: 1px solid var(--rmg-border);
    border-radius: 11px;
    background: color-mix(in srgb, var(--rmg-card) 96%, var(--rmg-bg));
    cursor: pointer;
}
.rmg-settings-check input {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: var(--rmg-secondary);
    flex: 0 0 auto;
}
.rmg-settings-check span { min-width: 0; display: grid; gap: 3px; }
.rmg-settings-check strong { color: var(--rmg-text); font-size: 12px; line-height: 1.35; }
.rmg-settings-check small { color: var(--rmg-muted); font-size: 10px; line-height: 1.45; }
.rmg-performance-note {
    margin-top: 14px;
    padding: 12px 14px;
    display: grid;
    gap: 3px;
    border: 1px solid color-mix(in srgb, var(--rmg-success) 26%, var(--rmg-border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--rmg-success) 6%, var(--rmg-card));
}
.rmg-performance-note strong { color: var(--rmg-text); font-size: 11px; }
.rmg-performance-note span { color: var(--rmg-muted); font-size: 10px; line-height: 1.5; }

.rmg-dashboard-primary.rmg-dashboard-count-1,
.rmg-dashboard-lower.rmg-dashboard-count-1 { grid-template-columns: minmax(0, 1fr); }
.rmg-dashboard-primary.rmg-dashboard-count-2,
.rmg-dashboard-lower.rmg-dashboard-count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rmg-dashboard-primary.rmg-dashboard-count-3 { grid-template-columns: minmax(0, 1.45fr) repeat(2, minmax(260px, .9fr)); }
.rmg-dashboard-lower.rmg-dashboard-count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rmg-dashboard-lower.rmg-dashboard-count-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

body.rmg-animations-disabled *,
body.rmg-animations-disabled *::before,
body.rmg-animations-disabled *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}
body.rmg-compact-ui .rmg-content { padding-top: 16px; padding-bottom: 16px; }
body.rmg-compact-ui .rmg-panel,
body.rmg-compact-ui .rmg-page-card,
body.rmg-compact-ui .rmg-settings-panel { padding-top: 14px; padding-bottom: 14px; }
body.rmg-compact-ui .rmg-dashboard-primary,
body.rmg-compact-ui .rmg-dashboard-lower,
body.rmg-compact-ui .rmg-metric-grid { gap: 10px; }

@media (max-width: 1180px) {
    .rmg-settings-form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rmg-settings-check-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rmg-dashboard-primary.rmg-dashboard-count-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rmg-dashboard-primary.rmg-dashboard-count-3 > :first-child { grid-column: 1 / -1; }
    .rmg-dashboard-lower.rmg-dashboard-count-3,
    .rmg-dashboard-lower.rmg-dashboard-count-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .rmg-settings-form-grid-3,
    .rmg-settings-check-grid,
    .rmg-settings-check-grid-4,
    .rmg-dashboard-primary.rmg-dashboard-count-2,
    .rmg-dashboard-primary.rmg-dashboard-count-3,
    .rmg-dashboard-lower.rmg-dashboard-count-2,
    .rmg-dashboard-lower.rmg-dashboard-count-3,
    .rmg-dashboard-lower.rmg-dashboard-count-4 { grid-template-columns: minmax(0, 1fr); }
    .rmg-dashboard-primary.rmg-dashboard-count-3 > :first-child { grid-column: auto; }
    .rmg-field-span-2 { grid-column: auto; }
}
.rmg-settings-textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
body.rmg-gradient-clean .rmg-sidebar { background: var(--rmg-sidebar-start) !important; }
body.rmg-gradient-deep-ocean .rmg-sidebar { background: linear-gradient(180deg, var(--rmg-sidebar-start) 0%, color-mix(in srgb, var(--rmg-sidebar-start) 62%, var(--rmg-secondary)) 58%, var(--rmg-sidebar-end) 100%) !important; }
.rmg-performance-note { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.rmg-performance-note > div { display: grid; gap: 3px; }
@media (max-width: 620px) { .rmg-performance-note { grid-template-columns: 1fr; } }

/* ========================================================================== 
   RMG Business Platform v0.6.1 — Approved Dashboard Reference Layout
   Matches the supplied 1536 × 1024 RMG Business Control Center composition.
   ========================================================================== */

/* Desktop shell */
.rmg-reference-dashboard-shell {
    --rmg-sidebar-width: var(--rmg-dashboard-sidebar-width, 284px);
    --rmg-topbar-height: 94px;
}

.rmg-reference-dashboard-shell .rmg-sidebar {
    width: var(--rmg-sidebar-width);
    padding: 24px 11px 22px;
    background: linear-gradient(180deg, var(--rmg-sidebar-start, #003653) 0%, var(--rmg-sidebar-end, #005170) 100%);
    box-shadow: none;
    border-right: 0;
}

.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-lockup {
    min-height: 61px;
    margin: 0 13px 15px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rmg-reference-dashboard-shell .rmg-sidebar .rmg-logo-mark {
    width: auto;
    min-width: 88px;
    height: 45px;
    padding: 0 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: 0;
    border-right: 2px solid rgba(255,255,255,.95);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #fff;
    font-size: 30px;
    font-weight: 850;
    letter-spacing: -1.9px;
}

.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-copy {
    min-width: 0;
    max-width: 103px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-copy strong,
.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-copy span {
    color: #fff;
    font-size: 14px;
    line-height: 1.02;
    font-weight: 750;
    letter-spacing: -.02em;
}

.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-copy strong {
    max-width: 92px;
}

.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-copy span {
    margin-top: 2px;
    font-weight: 500;
    color: rgba(255,255,255,.94);
}

.rmg-reference-dashboard-shell .rmg-nav-section-label { display: none !important; }

.rmg-reference-dashboard-shell .rmg-reference-nav {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0;
    padding: 0 15px 0 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.45) rgba(255,255,255,.11);
}

.rmg-reference-dashboard-shell .rmg-reference-nav::-webkit-scrollbar { width: 5px; }
.rmg-reference-dashboard-shell .rmg-reference-nav::-webkit-scrollbar-track { background: rgba(255,255,255,.10); border-radius: 999px; }
.rmg-reference-dashboard-shell .rmg-reference-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.48); border-radius: 999px; }

.rmg-reference-dashboard-shell .rmg-nav-item {
    min-height: 56px;
    padding: 0 18px;
    border-radius: 10px;
    gap: 17px;
    color: rgba(255,255,255,.96);
    font-size: var(--rmg-nav-font-size, 15px);
    font-weight: 590;
    letter-spacing: -.02em;
    transition: background .16s ease, color .16s ease;
}

.rmg-reference-dashboard-shell .rmg-nav-item:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
    transform: none;
}

.rmg-reference-dashboard-shell .rmg-nav-item.is-active {
    background: linear-gradient(90deg, rgba(43,137,189,.48), rgba(38,126,176,.58));
    color: #fff;
    box-shadow: none;
}

.rmg-reference-dashboard-shell .rmg-nav-icon {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    color: #fff;
}
.rmg-reference-dashboard-shell .rmg-nav-icon svg { width: 27px; height: 27px; stroke-width: 1.65; }

.rmg-reference-dashboard-shell .rmg-nav-badge {
    margin-left: auto;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: #0874b5;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.rmg-reference-dashboard-shell .rmg-reference-sidebar-footer {
    margin-top: auto;
    padding: 18px 12px 0;
}

.rmg-reference-dashboard-shell .rmg-sidebar-legal {
    margin: 0;
    color: rgba(255,255,255,.72);
    font-size: 12px;
    line-height: 1.7;
    font-weight: 400;
}
.rmg-reference-dashboard-shell .rmg-sidebar-legal span { color: rgba(255,255,255,.68); }

.rmg-reference-dashboard-shell .rmg-main {
    margin-left: var(--rmg-sidebar-width);
    min-height: 100vh;
    background: var(--rmg-bg, #f8fafc);
}

.rmg-reference-dashboard-shell .rmg-topbar {
    height: var(--rmg-topbar-height);
    padding: 0 26px;
    display: grid;
    grid-template-columns: minmax(410px, 1fr) 322px auto;
    align-items: center;
    gap: 20px;
    background: rgba(255,255,255,.98);
    border-bottom: 1px solid #e3e8ef;
    box-shadow: none;
    backdrop-filter: none;
}

.rmg-reference-dashboard-shell .rmg-menu-toggle { display: none; }
.rmg-reference-dashboard-shell .rmg-topbar-title { min-width: 0; }
.rmg-reference-dashboard-shell .rmg-topbar-title h1 {
    margin: 0;
    color: var(--rmg-text, #0a2747);
    font-size: var(--rmg-page-title-size, 28px);
    line-height: 1.08;
    font-weight: 760;
    letter-spacing: -.045em;
}
.rmg-reference-dashboard-shell .rmg-topbar-title p {
    margin: 7px 0 0;
    color: #607087;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 430;
}

.rmg-reference-dashboard-shell .rmg-search {
    width: 322px;
    max-width: 322px;
    min-width: 322px;
    flex: none;
}
.rmg-reference-dashboard-shell .rmg-search .rmg-input {
    width: 100%;
    height: 47px;
    padding: 0 18px 0 49px;
    border: 1px solid #d6dee8;
    border-radius: 7px;
    background: #fff;
    box-shadow: none;
    color: #273b56;
    font-size: 12px;
}
.rmg-reference-dashboard-shell .rmg-search > svg {
    top: 14px;
    left: 16px;
    width: 20px;
    height: 20px;
    color: #17375d;
}

.rmg-reference-dashboard-shell .rmg-top-actions {
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}
.rmg-reference-dashboard-shell .rmg-top-actions > .rmg-icon-btn {
    width: 42px;
    height: 42px;
    border: 1px solid #e0e6ee;
    border-radius: 50%;
    background: #fff;
    color: #082b4f;
    box-shadow: none;
}
.rmg-reference-dashboard-shell .rmg-top-actions > .rmg-icon-btn svg { width: 20px; height: 20px; }
.rmg-reference-dashboard-shell .rmg-notification-count {
    top: -5px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #005a91;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
}

.rmg-reference-dashboard-shell .rmg-user-menu {
    max-width: 285px;
    min-width: 252px;
    height: 56px;
    padding: 0 0 0 7px;
    gap: 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.rmg-reference-dashboard-shell .rmg-user-menu:hover { background: transparent; }
.rmg-reference-dashboard-shell .rmg-profile-avatar {
    width: 42px;
    height: 42px;
    border: 1px solid #e0e6ee;
    border-radius: 50%;
    background: #fff;
    color: #0a2747;
}
.rmg-reference-dashboard-shell .rmg-profile-avatar svg { width: 21px; height: 21px; }
.rmg-reference-dashboard-shell .rmg-user-copy strong {
    color: #0b2748;
    font-size: 11px;
    font-weight: 720;
    line-height: 1.15;
}
.rmg-reference-dashboard-shell .rmg-user-copy span {
    margin-top: 5px;
    color: #8793a5;
    font-size: 10px;
    text-transform: lowercase;
}
.rmg-reference-dashboard-shell .rmg-user-chevron { margin-left: auto; color: #0a2747; }
.rmg-reference-dashboard-shell .rmg-user-chevron svg { width: 15px; height: 15px; }

/* Dashboard body */
.rmg-reference-dashboard-shell .rmg-content {
    max-width: none;
    padding: 14px 26px 36px;
}

.rmg-reference-dashboard-shell .rmg-dashboard-toolbar {
    min-height: 58px;
    margin: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.rmg-reference-dashboard-shell .rmg-date-filter {
    min-width: 203px;
    height: 43px;
    padding: 0 14px;
    border: 1px solid #d8e0e9;
    border-radius: 8px;
    background: #fff;
    color: #102d4e;
    box-shadow: none;
    font-size: 12px;
    font-weight: 560;
    gap: 12px;
}
.rmg-reference-dashboard-shell .rmg-date-filter svg:first-child { width: 18px; height: 18px; }
.rmg-reference-dashboard-shell .rmg-date-filter svg:last-child { width: 14px; height: 14px; margin-left: auto; }

.rmg-reference-dashboard-shell .rmg-dashboard-actions { gap: 16px; }
.rmg-reference-dashboard-shell .rmg-dashboard-actions .rmg-btn {
    height: 43px;
    padding: 0 22px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 650;
    box-shadow: none;
}
.rmg-reference-dashboard-shell .rmg-export-button {
    min-width: 156px;
    border: 1px solid #d4dde7;
    background: #fff;
    color: #0a2747;
}
.rmg-reference-dashboard-shell .rmg-new-order-button {
    min-width: 175px;
    background: linear-gradient(90deg, #00628e 0%, #00557f 100%);
    border-color: transparent;
    color: #fff;
}
.rmg-reference-dashboard-shell .rmg-button-caret { margin-left: 17px; font-size: 15px; }

.rmg-reference-dashboard-shell .rmg-card {
    border: 1px solid var(--rmg-border, #dce5ee);
    border-radius: var(--rmg-radius, 12px);
    background: var(--rmg-card, #fff);
    box-shadow: none;
}
.rmg-reference-dashboard-shell .rmg-card:hover { box-shadow: none; transform: none; }

.rmg-reference-dashboard-shell .rmg-metric-grid {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 16px;
}
.rmg-reference-dashboard-shell .rmg-metric-card {
    min-height: 145px;
    padding: 14px 16px 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.rmg-reference-dashboard-shell .rmg-metric-main {
    display: grid;
    grid-template-columns: 64px minmax(0,1fr) 105px;
    align-items: center;
    gap: 12px;
}
.rmg-reference-dashboard-shell .rmg-metric-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eaf4fc;
    color: #082e52;
    box-shadow: none;
}
.rmg-reference-dashboard-shell .rmg-metric-icon svg { width: 31px; height: 31px; stroke-width: 1.65; }
.rmg-reference-dashboard-shell .rmg-metric-copy { min-width: 0; }
.rmg-reference-dashboard-shell .rmg-metric-label {
    display: block;
    color: #0c2949;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 540;
    white-space: nowrap;
}
.rmg-reference-dashboard-shell .rmg-metric-value {
    display: block;
    margin-top: 3px;
    color: #071f3d;
    font-size: var(--rmg-metric-value-size, 29px);
    line-height: 1;
    font-weight: 760;
    letter-spacing: -.035em;
}
.rmg-reference-dashboard-shell .rmg-sparkline {
    width: 102px;
    height: 42px;
    align-self: end;
}
.rmg-reference-dashboard-shell .rmg-sparkline path {
    fill: none;
    stroke: #0064f0;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.rmg-reference-dashboard-shell .rmg-metric-foot { margin-top: 10px; }
.rmg-reference-dashboard-shell .rmg-trend {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    font-size: 10px;
}
.rmg-reference-dashboard-shell .rmg-trend b { color: #00a255; font-size: 11px; font-weight: 720; }
.rmg-reference-dashboard-shell .rmg-trend.is-negative b { color: #d94855; }
.rmg-reference-dashboard-shell .rmg-trend span { color: #66758a; font-size: 10px; }

.rmg-reference-dashboard-shell .rmg-dashboard-primary {
    margin-top: 15px;
    display: grid;
    grid-template-columns: minmax(0, 1.58fr) minmax(0, 1.31fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}
.rmg-reference-dashboard-shell .rmg-dashboard-primary > .rmg-card { min-width: 0; min-height: 276px; }
.rmg-reference-dashboard-shell .rmg-panel { padding: 16px 18px; }
.rmg-reference-dashboard-shell .rmg-panel-head {
    min-height: 30px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.rmg-reference-dashboard-shell .rmg-panel-title h2,
.rmg-reference-dashboard-shell .rmg-quick-actions-panel > h2 {
    margin: 0;
    color: #0a2747;
    font-size: var(--rmg-section-title-size, 16px);
    line-height: 1.15;
    font-weight: 740;
    letter-spacing: -.03em;
}
.rmg-reference-dashboard-shell .rmg-link {
    color: #005fd7;
    font-size: 10px;
    font-weight: 650;
    text-decoration: none;
}
.rmg-reference-dashboard-shell .rmg-period-select {
    min-width: 142px;
    height: 35px !important;
    padding: 0 34px 0 14px !important;
    border: 1px solid #d7e0ea;
    border-radius: 7px;
    color: #0c2949;
    background-color: #fff;
    font-size: 11px;
    font-weight: 600;
}
.rmg-reference-dashboard-shell .rmg-chart-legend {
    gap: 18px;
    margin: 2px 0 5px;
    color: #586a82;
    font-size: 10px;
}
.rmg-reference-dashboard-shell .rmg-legend-dot { width: 8px; height: 8px; }
.rmg-reference-dashboard-shell .rmg-legend-dot.orders { background: #0067ed; }
.rmg-reference-dashboard-shell .rmg-legend-dot.revenue { background: #7186a1; }
.rmg-reference-dashboard-shell .rmg-chart-wrap { height: 196px; overflow: hidden; }
.rmg-reference-dashboard-shell .rmg-chart-wrap svg { width: 100%; height: 100%; }
.rmg-reference-dashboard-shell .rmg-chart-grid-line { stroke: #e4eaf0; stroke-dasharray: 4 4; }
.rmg-reference-dashboard-shell .rmg-chart-axis { fill: #718198; font-size: 8px; }
.rmg-reference-dashboard-shell .rmg-chart-bar { fill: #0067ed; opacity: .88; }
.rmg-reference-dashboard-shell .rmg-chart-line { stroke: #0067ed; stroke-width: 1.8; fill: none; }
.rmg-reference-dashboard-shell .rmg-chart-point { fill: #fff; stroke: #0067ed; stroke-width: 1.7; }

/* Action Center */
.rmg-reference-dashboard-shell .rmg-dashboard-action-panel { min-height: 276px; }
.rmg-reference-dashboard-shell .rmg-action-center-list { margin-top: 4px; }
.rmg-reference-dashboard-shell .rmg-action-center-row {
    min-height: 69px;
    padding: 10px 0;
    display: grid;
    grid-template-columns: 47px minmax(0,1fr) 77px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #dfe6ed;
}
.rmg-reference-dashboard-shell .rmg-action-center-row:last-child { border-bottom: 0; }
.rmg-reference-dashboard-shell .rmg-action-center-icon {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eef5fa;
    color: #0b3156;
}
.rmg-reference-dashboard-shell .rmg-action-center-icon svg { width: 24px; height: 24px; }
.rmg-reference-dashboard-shell .rmg-action-center-copy strong {
    display: block;
    color: #102b4b;
    font-size: 11px;
    font-weight: 700;
}
.rmg-reference-dashboard-shell .rmg-action-center-copy span {
    display: block;
    margin-top: 4px;
    color: #64758b;
    font-size: 10px;
}
.rmg-reference-dashboard-shell .rmg-action-view {
    width: 77px;
    height: 37px;
    padding: 0;
    display: inline-flex;
    justify-content: center;
    border: 1px solid #d1dbe6;
    border-radius: 7px;
    background: #fff;
    color: #0057b9;
    font-size: 10px;
    font-weight: 620;
}

/* Activity */
.rmg-reference-dashboard-shell .rmg-dashboard-activity-panel { min-height: 276px; }
.rmg-reference-dashboard-shell .rmg-activity-list { display: block; }
.rmg-reference-dashboard-shell .rmg-activity-item {
    min-height: 50px;
    padding: 7px 0;
    display: grid;
    grid-template-columns: 35px minmax(0,1fr) auto;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid #e4e9ef;
}
.rmg-reference-dashboard-shell .rmg-activity-item:last-child { border-bottom: 0; }
.rmg-reference-dashboard-shell .rmg-activity-icon {
    width: 33px;
    height: 33px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #edf5ff;
    color: #0068ef;
}
.rmg-reference-dashboard-shell .rmg-activity-icon svg { width: 20px; height: 20px; }
.rmg-reference-dashboard-shell .rmg-item-copy strong {
    display: block;
    color: #102b4b;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rmg-reference-dashboard-shell .rmg-item-copy span {
    display: block;
    margin-top: 3px;
    color: #748298;
    font-size: 9px;
}
.rmg-reference-dashboard-shell .rmg-time { color: #738197; font-size: 9px; white-space: nowrap; }

/* Quick actions exact full-width strip */
.rmg-reference-dashboard-shell .rmg-quick-actions-panel {
    min-height: 92px;
    margin-top: 15px;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 120px minmax(0,1fr);
    align-items: center;
    gap: 22px;
}
.rmg-reference-dashboard-shell .rmg-quick-actions-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 25px;
}
.rmg-reference-dashboard-shell .rmg-quick-action-card {
    min-height: 57px;
    padding: 9px 20px;
    display: flex;
    align-items: center;
    gap: 17px;
    border: 1px solid #d5dfe9;
    border-radius: 7px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: none;
}
.rmg-reference-dashboard-shell .rmg-quick-action-card:hover { border-color: #bfcddd; background: #fbfdff; }
.rmg-reference-dashboard-shell .rmg-quick-action-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: #0061e8;
    flex: 0 0 30px;
}
.rmg-reference-dashboard-shell .rmg-quick-action-icon svg { width: 27px; height: 27px; }
.rmg-reference-dashboard-shell .rmg-quick-action-card strong {
    display: block;
    color: #102b4b;
    font-size: 10px;
    line-height: 1.15;
    font-weight: 720;
}
.rmg-reference-dashboard-shell .rmg-quick-action-card small {
    display: block;
    margin-top: 3px;
    color: #748298;
    font-size: 9px;
    line-height: 1.15;
}

/* Lower four-card grid */
.rmg-reference-dashboard-shell .rmg-dashboard-lower {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 16px;
    align-items: stretch;
}
.rmg-reference-dashboard-shell .rmg-dashboard-lower > .rmg-card {
    min-height: 264px;
}
.rmg-reference-dashboard-shell .rmg-dashboard-lower-card { padding: 15px 17px 14px; }
.rmg-reference-dashboard-shell .rmg-dashboard-lower-card .rmg-panel-head { margin-bottom: 6px; }
.rmg-reference-dashboard-shell .rmg-dashboard-list { display: block; }
.rmg-reference-dashboard-shell .rmg-dashboard-order,
.rmg-reference-dashboard-shell .rmg-dashboard-simple-row,
.rmg-reference-dashboard-shell .rmg-dashboard-notification-row {
    min-height: 41px;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #e0e6ed;
}
.rmg-reference-dashboard-shell .rmg-dashboard-order strong,
.rmg-reference-dashboard-shell .rmg-dashboard-simple-row strong,
.rmg-reference-dashboard-shell .rmg-dashboard-notification-row strong {
    color: #102b4b;
    font-size: 9px;
    font-weight: 670;
}
.rmg-reference-dashboard-shell .rmg-dashboard-order > div > span {
    margin-top: 3px;
    color: #748298;
    font-size: 8px;
}
.rmg-reference-dashboard-shell .rmg-dashboard-order > b,
.rmg-reference-dashboard-shell .rmg-dashboard-simple-row > span {
    color: #102b4b;
    font-size: 9px;
    font-weight: 700;
}
.rmg-reference-dashboard-shell .rmg-new-pill { font-size: 7px !important; }
.rmg-reference-dashboard-shell .rmg-dashboard-fee-row {
    min-height: 41px;
    padding: 7px 0;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #e0e6ed;
}
.rmg-reference-dashboard-shell .rmg-dashboard-fee-row > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.rmg-reference-dashboard-shell .rmg-state-mark {
    width: 27px;
    height: 23px;
    border-radius: 5px;
    background: #eff3f7;
    color: #67778b;
    font-size: 7px;
}
.rmg-reference-dashboard-shell .rmg-dashboard-fee-row strong { color: #102b4b; font-size: 8.5px; font-weight: 650; }
.rmg-reference-dashboard-shell .rmg-dashboard-fee-row b { color: #102b4b; font-size: 8.5px; }
.rmg-reference-dashboard-shell .rmg-dashboard-fee-row .rmg-status {
    min-width: 49px;
    padding: 4px 7px;
    border-radius: 999px;
    background: #dff5e9;
    color: #178a54;
    font-size: 7px;
}
.rmg-reference-dashboard-shell .rmg-dashboard-notification-row > span {
    font-size: 8.5px;
    font-weight: 650;
}
.rmg-reference-dashboard-shell .rmg-dashboard-notification-row > span.is-enabled { color: #008c48; }
.rmg-reference-dashboard-shell .rmg-dashboard-master-toggle {
    width: 35px;
    height: 20px;
    padding: 3px;
    display: flex;
    justify-content: flex-end;
    border: 0;
    border-radius: 999px;
    background: #00699b;
}
.rmg-reference-dashboard-shell .rmg-dashboard-master-toggle i {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: none;
}
.rmg-reference-dashboard-shell .rmg-panel-footer-link {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
}
.rmg-reference-dashboard-shell .rmg-panel-footer-link svg { width: 11px; height: 11px; }

.rmg-reference-dashboard-shell .rmg-dashboard-orders-empty {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6e7e93;
}
.rmg-reference-dashboard-shell .rmg-empty-order-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 8px;
    border-radius: 50%;
    background: #edf6fc;
    color: #0a3356;
}
.rmg-reference-dashboard-shell .rmg-empty-order-icon svg { width: 29px; height: 29px; }
.rmg-reference-dashboard-shell .rmg-dashboard-orders-empty strong { color: #102b4b; font-size: 10px; font-weight: 700; }
.rmg-reference-dashboard-shell .rmg-dashboard-orders-empty span { margin-top: 7px; color: #718097; font-size: 9px; }
.rmg-reference-dashboard-shell .rmg-empty-order-button {
    width: 129px;
    height: 41px;
    margin-top: 15px;
    border: 1px solid #d6e0ea;
    border-radius: 6px;
    background: #fff;
    color: #005bb7;
    font-size: 10px;
    font-weight: 650;
}

/* Exact reference dashboard should sit still; only basic hover feedback is retained. */
.rmg-reference-dashboard-shell .rmg-metric-card,
.rmg-reference-dashboard-shell .rmg-dashboard-primary > .rmg-card,
.rmg-reference-dashboard-shell .rmg-dashboard-lower > .rmg-card {
    animation: none !important;
}

/* Responsive behavior keeps the exact desktop design above 1200px while preventing clipping below it. */
@media (max-width: 1320px) {
    .rmg-reference-dashboard-shell { --rmg-sidebar-width: 250px; }
    .rmg-reference-dashboard-shell .rmg-topbar { grid-template-columns: minmax(330px,1fr) minmax(260px,322px) auto; gap: 14px; padding: 0 20px; }
    .rmg-reference-dashboard-shell .rmg-content { padding-left: 20px; padding-right: 20px; }
    .rmg-reference-dashboard-shell .rmg-user-menu { min-width: 210px; }
    .rmg-reference-dashboard-shell .rmg-metric-main { grid-template-columns: 58px minmax(0,1fr) 86px; }
    .rmg-reference-dashboard-shell .rmg-sparkline { width: 84px; }
    .rmg-reference-dashboard-shell .rmg-dashboard-primary { grid-template-columns: minmax(0,1.55fr) minmax(300px,1.2fr); }
    .rmg-reference-dashboard-shell .rmg-dashboard-activity-panel { grid-column: 1 / -1; min-height: auto; }
    .rmg-reference-dashboard-shell .rmg-dashboard-activity-panel .rmg-activity-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 24px; }
    .rmg-reference-dashboard-shell .rmg-quick-actions-list { gap: 12px; }
}

@media (max-width: 1080px) {
    .rmg-reference-dashboard-shell .rmg-sidebar { transform: translateX(-105%); transition: transform .22s ease; }
    .rmg-reference-dashboard-shell .rmg-sidebar.is-open { transform: translateX(0); }
    .rmg-reference-dashboard-shell .rmg-main { margin-left: 0; }
    .rmg-reference-dashboard-shell .rmg-menu-toggle { display: inline-grid; }
    .rmg-reference-dashboard-shell .rmg-topbar { grid-template-columns: auto minmax(260px,1fr) minmax(230px,300px) auto; }
    .rmg-reference-dashboard-shell .rmg-topbar-title { grid-column: 2; }
    .rmg-reference-dashboard-shell .rmg-search { width: 100%; min-width: 0; max-width: 300px; }
    .rmg-reference-dashboard-shell .rmg-user-copy { display: none; }
    .rmg-reference-dashboard-shell .rmg-user-menu { min-width: auto; }
    .rmg-reference-dashboard-shell .rmg-user-chevron { display: none; }
    .rmg-reference-dashboard-shell .rmg-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .rmg-reference-dashboard-shell .rmg-dashboard-lower { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .rmg-reference-dashboard-shell .rmg-quick-actions-panel { grid-template-columns: 1fr; gap: 12px; }
    .rmg-reference-dashboard-shell .rmg-quick-actions-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
    .rmg-reference-dashboard-shell .rmg-topbar { height: auto; min-height: 82px; padding: 12px 14px; display: flex; flex-wrap: wrap; }
    .rmg-reference-dashboard-shell .rmg-topbar-title { flex: 1 1 220px; }
    .rmg-reference-dashboard-shell .rmg-topbar-title h1 { font-size: 21px; }
    .rmg-reference-dashboard-shell .rmg-search { order: 3; width: 100%; max-width: none; flex-basis: 100%; }
    .rmg-reference-dashboard-shell .rmg-content { padding: 14px; }
    .rmg-reference-dashboard-shell .rmg-dashboard-toolbar { flex-direction: column; gap: 10px; margin-bottom: 12px; }
    .rmg-reference-dashboard-shell .rmg-dashboard-actions { width: 100%; }
    .rmg-reference-dashboard-shell .rmg-dashboard-actions .rmg-btn { flex: 1; min-width: 0; }
    .rmg-reference-dashboard-shell .rmg-metric-grid,
    .rmg-reference-dashboard-shell .rmg-dashboard-primary,
    .rmg-reference-dashboard-shell .rmg-dashboard-lower { grid-template-columns: 1fr; }
    .rmg-reference-dashboard-shell .rmg-dashboard-activity-panel { grid-column: auto; }
    .rmg-reference-dashboard-shell .rmg-dashboard-activity-panel .rmg-activity-list { display: block; }
    .rmg-reference-dashboard-shell .rmg-quick-actions-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .rmg-reference-dashboard-shell .rmg-top-actions > .rmg-icon-btn:first-child { display: none; }
    .rmg-reference-dashboard-shell .rmg-metric-main { grid-template-columns: 56px minmax(0,1fr); }
    .rmg-reference-dashboard-shell .rmg-sparkline { display: none; }
    .rmg-reference-dashboard-shell .rmg-dashboard-actions { flex-direction: column; }
    .rmg-reference-dashboard-shell .rmg-date-filter { width: 100%; }
}

/* ========================================================================== 
   RMG Business Platform v0.6.3 — Readability + No Horizontal Page Scroll
   Keeps the approved dashboard composition while improving laptop rendering.
   ========================================================================== */

/* Never allow the application shell to create a browser-level horizontal bar. */
html:has(body.rmg-app-page),
body.rmg-app-page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.rmg-reference-dashboard-shell,
.rmg-reference-dashboard-shell .rmg-main,
.rmg-reference-dashboard-shell .rmg-content,
.rmg-reference-dashboard-shell .rmg-topbar {
    width: auto;
    max-width: 100%;
    min-width: 0;
}

.rmg-reference-dashboard-shell .rmg-main,
.rmg-reference-dashboard-shell .rmg-content {
    overflow-x: clip;
}

/* Let grid/flex children shrink inside the available viewport instead of
   pushing the entire document wider than the browser window. */
.rmg-reference-dashboard-shell .rmg-topbar > *,
.rmg-reference-dashboard-shell .rmg-dashboard-toolbar > *,
.rmg-reference-dashboard-shell .rmg-metric-grid > *,
.rmg-reference-dashboard-shell .rmg-dashboard-primary > *,
.rmg-reference-dashboard-shell .rmg-quick-actions-list > *,
.rmg-reference-dashboard-shell .rmg-dashboard-lower > *,
.rmg-reference-dashboard-shell .rmg-panel,
.rmg-reference-dashboard-shell .rmg-card {
    min-width: 0;
    max-width: 100%;
}

/* Readability pass — the structure/layout is unchanged; only typography is
   made easier to read on normal 100% browser zoom. */
.rmg-reference-dashboard-shell {
    --rmg-page-title-size: 30px;
    --rmg-section-title-size: 17px;
    --rmg-nav-font-size: 16px;
    --rmg-metric-value-size: 31px;
}

.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-copy strong,
.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-copy span { font-size: 15px; }
.rmg-reference-dashboard-shell .rmg-sidebar-legal { font-size: 12.5px; }

.rmg-reference-dashboard-shell .rmg-topbar-title p { font-size: 13px; }
.rmg-reference-dashboard-shell .rmg-search .rmg-input { font-size: 13px; }
.rmg-reference-dashboard-shell .rmg-user-copy strong { font-size: 12px; }
.rmg-reference-dashboard-shell .rmg-user-copy span { font-size: 11px; }

.rmg-reference-dashboard-shell .rmg-date-filter,
.rmg-reference-dashboard-shell .rmg-dashboard-actions .rmg-btn { font-size: 13px; }

.rmg-reference-dashboard-shell .rmg-metric-label { font-size: 14px; }
.rmg-reference-dashboard-shell .rmg-trend,
.rmg-reference-dashboard-shell .rmg-trend span { font-size: 11.5px; }
.rmg-reference-dashboard-shell .rmg-trend b { font-size: 12px; }

.rmg-reference-dashboard-shell .rmg-link { font-size: 11.5px; }
.rmg-reference-dashboard-shell .rmg-period-select { font-size: 12px; }
.rmg-reference-dashboard-shell .rmg-chart-legend { font-size: 11px; }
.rmg-reference-dashboard-shell .rmg-chart-axis { font-size: 9.5px; }

.rmg-reference-dashboard-shell .rmg-action-center-copy strong { font-size: 12.5px; }
.rmg-reference-dashboard-shell .rmg-action-center-copy span { font-size: 11px; }
.rmg-reference-dashboard-shell .rmg-action-view { font-size: 11px; }

.rmg-reference-dashboard-shell .rmg-item-copy strong { font-size: 11.5px; }
.rmg-reference-dashboard-shell .rmg-item-copy span { font-size: 10px; }
.rmg-reference-dashboard-shell .rmg-time { font-size: 10px; }

.rmg-reference-dashboard-shell .rmg-quick-action-card strong { font-size: 11.5px; }
.rmg-reference-dashboard-shell .rmg-quick-action-card small { font-size: 10.5px; }

.rmg-reference-dashboard-shell .rmg-dashboard-order strong,
.rmg-reference-dashboard-shell .rmg-dashboard-simple-row strong,
.rmg-reference-dashboard-shell .rmg-dashboard-notification-row strong { font-size: 10.5px; }
.rmg-reference-dashboard-shell .rmg-dashboard-order > div > span { font-size: 9.5px; }
.rmg-reference-dashboard-shell .rmg-dashboard-order > b,
.rmg-reference-dashboard-shell .rmg-dashboard-simple-row > span { font-size: 10.5px; }
.rmg-reference-dashboard-shell .rmg-new-pill { font-size: 8.5px !important; }
.rmg-reference-dashboard-shell .rmg-dashboard-fee-row strong,
.rmg-reference-dashboard-shell .rmg-dashboard-fee-row b { font-size: 10px; }
.rmg-reference-dashboard-shell .rmg-dashboard-fee-row .rmg-status { font-size: 8.5px; }
.rmg-reference-dashboard-shell .rmg-dashboard-notification-row > span { font-size: 10px; }
.rmg-reference-dashboard-shell .rmg-panel-footer-link { font-size: 11px; }
.rmg-reference-dashboard-shell .rmg-dashboard-orders-empty strong { font-size: 12px; }
.rmg-reference-dashboard-shell .rmg-dashboard-orders-empty span { font-size: 10.5px; }
.rmg-reference-dashboard-shell .rmg-empty-order-button { font-size: 11.5px; }

/* 1366px-class laptop fix: retain all controls but compress only the header
   proportions enough to fit within the available main column. */
@media (max-width: 1450px) and (min-width: 1081px) {
    .rmg-reference-dashboard-shell { --rmg-sidebar-width: 250px; }
    .rmg-reference-dashboard-shell .rmg-topbar {
        padding-left: 18px;
        padding-right: 18px;
        gap: 12px;
        grid-template-columns: minmax(285px, 1fr) minmax(225px, 285px) minmax(300px, auto);
    }
    .rmg-reference-dashboard-shell .rmg-search {
        width: 100%;
        min-width: 0;
        max-width: 285px;
    }
    .rmg-reference-dashboard-shell .rmg-top-actions { gap: 8px; min-width: 0; }
    .rmg-reference-dashboard-shell .rmg-top-actions > .rmg-icon-btn { width: 39px; height: 39px; flex: 0 0 39px; }
    .rmg-reference-dashboard-shell .rmg-user-menu { min-width: 188px; max-width: 210px; gap: 8px; }
    .rmg-reference-dashboard-shell .rmg-user-copy strong { max-width: 132px; }
    .rmg-reference-dashboard-shell .rmg-content { padding-left: 18px; padding-right: 18px; }
}

/* Slightly tighten the typography only when the viewport becomes narrow,
   avoiding text collisions while staying larger than v0.6.1. */
@media (max-width: 1220px) {
    .rmg-reference-dashboard-shell { --rmg-nav-font-size: 15px; --rmg-section-title-size: 16px; }
    .rmg-reference-dashboard-shell .rmg-metric-label { font-size: 13px; }
}

/* ========================================================================== 
   RMG Business Platform v0.6.3 — Global Readability Scale
   Raises the minimum readable type across every SaaS screen while preserving
   the approved dashboard structure and administrator typography controls.
   ========================================================================== */
:root {
    --rmg-base-font-size: 16px;
    --rmg-page-title-size: 30px;
    --rmg-section-title-size: 18px;
    --rmg-nav-font-size: 16px;
    --rmg-metric-value-size: 32px;
}

body.rmg-app-page {
    font-size: max(var(--rmg-base-font-size), 16px);
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Shared controls */
.rmg-field { gap: 8px; }
.rmg-field label { font-size: 13px; line-height: 1.35; }
.rmg-help { font-size: 12.5px; line-height: 1.55; }
.rmg-input,
.rmg-select,
.rmg-textarea { font-size: 14px; line-height: 1.45; }
.rmg-input,
.rmg-select { min-height: 46px; }
.rmg-btn { min-height: 43px; font-size: 13.5px; }
.rmg-btn-sm { min-height: 36px; font-size: 12.5px; }
.rmg-checkbox { font-size: 13px; line-height: 1.45; }
.rmg-alert { font-size: 13px; line-height: 1.5; }

/* Navigation + header */
.rmg-reference-dashboard-shell .rmg-nav-item {
    font-size: max(var(--rmg-nav-font-size), 16px);
    line-height: 1.25;
}
.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-copy strong,
.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-copy span { font-size: 15.5px; }
.rmg-reference-dashboard-shell .rmg-sidebar-legal { font-size: 13px; line-height: 1.65; }
.rmg-reference-dashboard-shell .rmg-topbar-title h1 { font-size: max(var(--rmg-page-title-size), 30px); }
.rmg-reference-dashboard-shell .rmg-topbar-title p { font-size: 14px; line-height: 1.35; }
.rmg-reference-dashboard-shell .rmg-search .rmg-input { font-size: 14px; }
.rmg-reference-dashboard-shell .rmg-user-copy strong { font-size: 13px; line-height: 1.25; }
.rmg-reference-dashboard-shell .rmg-user-copy span { font-size: 12px; line-height: 1.3; }
.rmg-profile-popover strong { font-size: 13px; }
.rmg-profile-popover small { font-size: 11.5px; line-height: 1.4; }

/* Dashboard */
.rmg-reference-dashboard-shell .rmg-date-filter,
.rmg-reference-dashboard-shell .rmg-dashboard-actions .rmg-btn { font-size: 14px; }
.rmg-reference-dashboard-shell .rmg-panel-title h2,
.rmg-reference-dashboard-shell .rmg-dashboard-lower .rmg-panel-title h2 { font-size: max(var(--rmg-section-title-size), 18px); }
.rmg-reference-dashboard-shell .rmg-metric-label { font-size: 15px; line-height: 1.25; }
.rmg-reference-dashboard-shell .rmg-metric-value { font-size: max(var(--rmg-metric-value-size), 32px); }
.rmg-reference-dashboard-shell .rmg-trend,
.rmg-reference-dashboard-shell .rmg-trend span { font-size: 12.5px; }
.rmg-reference-dashboard-shell .rmg-trend b { font-size: 13px; }
.rmg-reference-dashboard-shell .rmg-link,
.rmg-reference-dashboard-shell .rmg-panel-footer-link { font-size: 12.5px; }
.rmg-reference-dashboard-shell .rmg-period-select { font-size: 13px; }
.rmg-reference-dashboard-shell .rmg-chart-legend { font-size: 12px; }
.rmg-reference-dashboard-shell .rmg-chart-axis { font-size: 10.5px; }
.rmg-reference-dashboard-shell .rmg-action-center-copy strong { font-size: 13.5px; }
.rmg-reference-dashboard-shell .rmg-action-center-copy span { font-size: 12px; }
.rmg-reference-dashboard-shell .rmg-action-view { font-size: 12px; }
.rmg-reference-dashboard-shell .rmg-item-copy strong { font-size: 12.5px; line-height: 1.35; }
.rmg-reference-dashboard-shell .rmg-item-copy span { font-size: 11.5px; line-height: 1.4; }
.rmg-reference-dashboard-shell .rmg-time,
.rmg-reference-dashboard-shell .rmg-live-label { font-size: 11px; }
.rmg-reference-dashboard-shell .rmg-quick-action-card strong { font-size: 12.5px; }
.rmg-reference-dashboard-shell .rmg-quick-action-card small { font-size: 11.5px; line-height: 1.35; }
.rmg-reference-dashboard-shell .rmg-dashboard-order strong,
.rmg-reference-dashboard-shell .rmg-dashboard-simple-row strong,
.rmg-reference-dashboard-shell .rmg-dashboard-notification-row strong { font-size: 12px; }
.rmg-reference-dashboard-shell .rmg-dashboard-order > div > span { font-size: 11px; line-height: 1.35; }
.rmg-reference-dashboard-shell .rmg-dashboard-order > b,
.rmg-reference-dashboard-shell .rmg-dashboard-simple-row > span { font-size: 12px; }
.rmg-reference-dashboard-shell .rmg-new-pill { font-size: 10px !important; }
.rmg-reference-dashboard-shell .rmg-dashboard-fee-row strong,
.rmg-reference-dashboard-shell .rmg-dashboard-fee-row b { font-size: 11.5px; }
.rmg-reference-dashboard-shell .rmg-dashboard-fee-row .rmg-status { font-size: 10px; }
.rmg-reference-dashboard-shell .rmg-dashboard-notification-row > span { font-size: 11.5px; }
.rmg-reference-dashboard-shell .rmg-dashboard-orders-empty strong { font-size: 13px; }
.rmg-reference-dashboard-shell .rmg-dashboard-orders-empty span { font-size: 11.5px; }
.rmg-reference-dashboard-shell .rmg-empty-order-button { font-size: 12.5px; }

/* Data tables — Orders, Clients, Approvals, Services, State Fees, Documents. */
.rmg-table th {
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 11.5px;
    line-height: 1.3;
    letter-spacing: .035em;
}
.rmg-table td {
    padding-top: 13px;
    padding-bottom: 13px;
    font-size: 13px;
    line-height: 1.45;
}
.rmg-id { font-size: 13px; }
.rmg-mini-avatar { font-size: 11px; }
.rmg-status { min-height: 25px; font-size: 10.5px; line-height: 1.2; }

/* Settings / Appearance */
.rmg-settings-eyebrow { font-size: 11px; }
.rmg-interface-settings-head h2 { font-size: 29px; }
.rmg-interface-settings-head p { font-size: 13px; line-height: 1.55; }
.rmg-settings-panel-head > div > span { font-size: 11px; }
.rmg-settings-panel-head h3 { font-size: 16px; line-height: 1.3; }
.rmg-settings-panel-head p { font-size: 11.5px; line-height: 1.45; }
.rmg-settings-panel .rmg-field label { font-size: 12.5px; }
.rmg-settings-panel .rmg-input,
.rmg-settings-panel .rmg-select,
.rmg-settings-panel .rmg-textarea { font-size: 13.5px; }
.rmg-settings-panel .rmg-select { min-height: 44px; }
.rmg-settings-panel .rmg-color-input code { font-size: 11px; }
.rmg-number-control > span { font-size: 11px; }
.rmg-nav-editor-name .rmg-input { font-size: 13px; }
.rmg-nav-editor-name span { font-size: 10.5px; line-height: 1.35; }
.rmg-nav-visibility b { font-size: 10.5px; }
.rmg-add-tab-title strong { font-size: 13px; }
.rmg-add-tab-title span { font-size: 11px; }
.rmg-settings-footer-row span { font-size: 11px; line-height: 1.45; }
.rmg-settings-check strong { font-size: 13px; }
.rmg-settings-check small { font-size: 11.5px; }
.rmg-performance-note strong { font-size: 12.5px; }
.rmg-performance-note span { font-size: 11.5px; }

/* Common page/card headings outside Dashboard. */
.rmg-content > h1,
.rmg-page-header h1 { font-size: 30px; }
.rmg-card h2,
.rmg-panel h2 { line-height: 1.25; }

/* Keep the larger scale comfortable on compact screens instead of shrinking
   back to the old 9–11px typography. */
@media (max-width: 760px) {
    body.rmg-app-page { font-size: max(var(--rmg-base-font-size), 15px); }
    .rmg-reference-dashboard-shell .rmg-topbar-title h1 { font-size: max(23px, min(var(--rmg-page-title-size), 30px)); }
    .rmg-reference-dashboard-shell .rmg-nav-item { font-size: max(15px, min(var(--rmg-nav-font-size), 18px)); }
    .rmg-table th { font-size: 11px; }
    .rmg-table td { font-size: 12.5px; }
    .rmg-settings-panel-head p { text-align: left; }
}


/* ========================================================================== 
   RMG Business Platform v0.7.0 — Premium Website Theme Integration
   Mirrors the approved RMG website language: Poppins, #04336B, restrained
   soft-glass surfaces, readable typography and the exact light header gradient.
   ========================================================================== */

:root {
    --rmg-primary: #04336B;
    --rmg-secondary: #075B96;
    --rmg-accent: #0B70BE;
    --rmg-sidebar-start: #04336B;
    --rmg-sidebar-end: #02264F;
    --rmg-bg: #F8FAFC;
    --rmg-card: rgba(255,255,255,.82);
    --rmg-border: #DEE6ED;
    --rmg-text: #131A23;
    --rmg-muted: #66758A;
    --rmg-radius: 18px;
    --rmg-shadow: 0 12px 34px rgba(4,51,107,.055);
    --rmg-shadow-hover: 0 20px 48px rgba(4,51,107,.095);
    --rmg-premium-page-bg: linear-gradient(180deg, rgba(250,251,252,.98), rgba(247,249,251,.98));
    --rmg-premium-blue: linear-gradient(135deg, #0768A8 0%, #04336B 64%, #02264F 100%);
    --rmg-font-family: Poppins, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body.rmg-app-page { background: #F8FAFC; }
body.rmg-app-page {
    color: var(--rmg-text);
    font-family: var(--rmg-font-family);
    font-size: var(--rmg-base-font-size, 16px);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Loading + auth use the exact website header background. */
.rmg-loading-screen,
.rmg-auth-shell {
    position: relative;
    overflow: hidden;
    background: var(--rmg-premium-page-bg);
}
.rmg-loading-screen::before,
.rmg-auth-shell::before,
.rmg-loading-screen::after,
.rmg-auth-shell::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
}
.rmg-loading-screen::before,
.rmg-auth-shell::before {
    width: 520px; height: 520px; right: -250px; top: -280px;
    background: radial-gradient(circle, rgba(11,112,190,.10), transparent 70%);
}
.rmg-loading-screen::after,
.rmg-auth-shell::after {
    width: 430px; height: 430px; left: -260px; bottom: -250px;
    background: radial-gradient(circle, rgba(4,51,107,.06), transparent 70%);
}
.rmg-loading-screen > *, .rmg-auth-shell > * { position: relative; z-index: 2; }
.rmg-loader-mark {
    width: 82px; height: 62px; border: 0; border-radius: 18px;
    color: #fff; background: var(--rmg-premium-blue);
    font-size: 24px; font-weight: 500; letter-spacing: -.04em;
    box-shadow: 0 15px 34px rgba(4,51,107,.20);
}

/* Brand asset used across the app. */
.rmg-brand-lockup.rmg-premium-brand { min-width: 0; }
.rmg-brand-logo-image {
    display: block;
    width: min(100%, 214px);
    height: auto;
    max-height: 62px;
    object-fit: contain;
    object-position: left center;
}
.rmg-brand-text-fallback { display: none !important; }

/* Authentication */
.rmg-auth-card {
    width: min(100%, 1040px);
    min-height: 640px;
    border: 1px solid rgba(4,51,107,.08);
    border-radius: 30px;
    background: rgba(255,255,255,.76);
    box-shadow: 0 30px 82px rgba(4,51,107,.13);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.rmg-auth-brand {
    position: relative;
    padding: 48px;
    color: #fff;
    background: radial-gradient(circle at 80% 10%, rgba(255,255,255,.14), transparent 31%), var(--rmg-premium-blue);
}
.rmg-auth-brand .rmg-brand-lockup {
    align-self: flex-start;
    width: min(100%, 252px);
    padding: 11px 13px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 16px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 12px 30px rgba(0,0,0,.11);
}
.rmg-auth-brand .rmg-brand-logo-image { width: 100%; max-height: 62px; }
.rmg-auth-brand h1 { font-size: clamp(36px, 4.2vw, 54px); font-weight: 500; letter-spacing: -.045em; }
.rmg-auth-brand p { font-size: 15px; line-height: 1.75; color: rgba(255,255,255,.78); }
.rmg-auth-feature { font-size: 14px; font-weight: 400; }
.rmg-auth-feature span:first-child { width: 28px; height: 28px; background: rgba(255,255,255,.12); }
.rmg-auth-form-wrap { padding: 56px clamp(30px,5vw,70px); background: rgba(255,255,255,.64); }
.rmg-auth-form-wrap h2 { font-size: 31px; font-weight: 500; color: var(--rmg-text); }
.rmg-auth-form-wrap > p { font-size: 15px; color: var(--rmg-muted); }
.rmg-auth-links, .rmg-auth-links a { font-size: 14px; }
.rmg-auth-links a { color: var(--rmg-primary); font-weight: 500; }

/* Core controls */
.rmg-field { gap: 8px; }
.rmg-field label { color: #24384c; font-size: 13px; font-weight: 500; }
.rmg-input,
.rmg-select,
.rmg-textarea {
    border: 1px solid rgba(4,51,107,.12);
    border-radius: 12px;
    background: rgba(255,255,255,.92);
    color: var(--rmg-text);
    font-size: 14px;
    font-weight: 400;
    box-shadow: 0 4px 14px rgba(4,51,107,.018);
}
.rmg-input, .rmg-select { height: 50px; }
.rmg-input:focus, .rmg-select:focus, .rmg-textarea:focus {
    border-color: rgba(11,112,190,.55);
    box-shadow: 0 0 0 3px rgba(11,112,190,.08), 0 8px 22px rgba(4,51,107,.04);
}
.rmg-btn {
    min-height: 44px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    box-shadow: none;
}
.rmg-btn-primary { background: var(--rmg-premium-blue); box-shadow: 0 10px 23px rgba(4,51,107,.17); }
.rmg-btn-primary:hover { box-shadow: 0 15px 30px rgba(4,51,107,.22); }
.rmg-btn-dark { background: var(--rmg-primary); box-shadow: 0 9px 20px rgba(4,51,107,.14); }
.rmg-btn-light { color: var(--rmg-primary); background: rgba(255,255,255,.82); border-color: rgba(4,51,107,.10); }

/* Exact website theme across the app shell. */
.rmg-reference-dashboard-shell { --rmg-topbar-height: 94px; }
.rmg-reference-dashboard-shell .rmg-main {
    background: var(--rmg-premium-page-bg) !important;
}
.rmg-reference-dashboard-shell .rmg-main::before {
    content: "";
    position: fixed;
    z-index: 0;
    width: 480px; height: 480px;
    right: -250px; bottom: -260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(11,112,190,.055), transparent 70%);
    pointer-events: none;
}
.rmg-reference-dashboard-shell .rmg-content,
.rmg-reference-dashboard-shell .rmg-topbar { position: relative; z-index: 2; }

/* Light premium sidebar — the same design language as the website floating nav. */
.rmg-reference-dashboard-shell .rmg-sidebar {
    width: var(--rmg-sidebar-width);
    padding: 19px 13px 18px;
    background: var(--rmg-premium-page-bg) !important;
    border-right: 1px solid rgba(4,51,107,.08);
    box-shadow: 10px 0 34px rgba(4,51,107,.035);
    color: var(--rmg-text);
}
.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-lockup {
    min-height: 72px;
    margin: 0 8px 16px;
    padding: 10px 12px;
    border: 1px solid rgba(4,51,107,.07);
    border-radius: 17px;
    background: rgba(255,255,255,.70);
    box-shadow: 0 10px 28px rgba(4,51,107,.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-logo-image { width: min(100%, 220px); max-height: 58px; }
.rmg-reference-dashboard-shell .rmg-reference-nav {
    gap: 5px;
    padding: 3px 7px 0;
    scrollbar-color: rgba(4,51,107,.18) transparent;
}
.rmg-reference-dashboard-shell .rmg-reference-nav::-webkit-scrollbar-track { background: transparent; }
.rmg-reference-dashboard-shell .rmg-reference-nav::-webkit-scrollbar-thumb { background: rgba(4,51,107,.16); }
.rmg-reference-dashboard-shell .rmg-nav-item {
    position: relative;
    min-height: 53px;
    padding: 0 14px;
    gap: 13px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: #51606d;
    font-size: max(var(--rmg-nav-font-size,16px), 15px);
    font-weight: 400;
    letter-spacing: -.01em;
    transition: color .22s ease, background .22s ease, border-color .22s ease, transform .22s ease, box-shadow .22s ease;
}
.rmg-reference-dashboard-shell .rmg-nav-item:hover {
    color: var(--rmg-primary);
    background: rgba(255,255,255,.64);
    border-color: rgba(4,51,107,.06);
    transform: translateX(2px);
    box-shadow: 0 7px 18px rgba(4,51,107,.03);
}
.rmg-reference-dashboard-shell .rmg-nav-item.is-active {
    color: var(--rmg-primary);
    background: rgba(255,255,255,.94);
    border-color: rgba(4,51,107,.09);
    box-shadow: 0 9px 24px rgba(4,51,107,.065);
    font-weight: 500;
}
.rmg-reference-dashboard-shell .rmg-nav-item.is-active::before {
    content: "";
    position: absolute;
    left: 5px; top: 50%;
    width: 3px; height: 22px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: linear-gradient(180deg, var(--rmg-accent), var(--rmg-primary));
}
.rmg-reference-dashboard-shell .rmg-nav-icon {
    width: 35px; height: 35px; flex: 0 0 35px;
    display: grid; place-items: center;
    border-radius: 10px;
    color: var(--rmg-primary);
    background: rgba(4,51,107,.045);
    transition: color .22s ease, background .22s ease, transform .22s ease;
}
.rmg-reference-dashboard-shell .rmg-nav-icon svg { width: 19px; height: 19px; stroke-width: 1.7; }
.rmg-reference-dashboard-shell .rmg-nav-item.is-active .rmg-nav-icon,
.rmg-reference-dashboard-shell .rmg-nav-item:hover .rmg-nav-icon {
    color: #fff; background: var(--rmg-premium-blue);
}
.rmg-reference-dashboard-shell .rmg-nav-item:hover .rmg-nav-icon { transform: rotate(-3deg); }
.rmg-reference-dashboard-shell .rmg-nav-badge {
    min-width: 25px; height: 25px; border: 0;
    background: rgba(4,51,107,.07); color: var(--rmg-primary); font-weight: 500;
}
.rmg-reference-dashboard-shell .rmg-nav-item.is-active .rmg-nav-badge { background: var(--rmg-primary); color:#fff; }
.rmg-reference-dashboard-shell .rmg-reference-sidebar-footer { padding: 15px 12px 0; border-top: 1px solid rgba(4,51,107,.07); }
.rmg-reference-dashboard-shell .rmg-sidebar-legal,
.rmg-reference-dashboard-shell .rmg-sidebar-legal span { color: #84909a; font-size: 11px; line-height: 1.65; }

/* Sticky glass topbar — exact website header background. */
.rmg-reference-dashboard-shell .rmg-topbar {
    position: sticky !important;
    top: 0;
    z-index: 35;
    height: var(--rmg-topbar-height);
    padding: 0 27px;
    grid-template-columns: minmax(360px,1fr) minmax(260px,340px) auto;
    gap: 18px;
    background: var(--rmg-premium-page-bg) !important;
    border-bottom: 1px solid rgba(4,51,107,.07);
    box-shadow: 0 7px 25px rgba(4,51,107,.025);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: box-shadow .25s ease, height .25s ease;
}
.rmg-app-scrolled .rmg-topbar { box-shadow: 0 12px 32px rgba(4,51,107,.075); }
.rmg-reference-dashboard-shell .rmg-topbar-title h1 {
    color: var(--rmg-text);
    font-size: max(var(--rmg-page-title-size,32px), 30px);
    line-height: 1.08;
    font-weight: 500;
    letter-spacing: -.04em;
}
.rmg-reference-dashboard-shell .rmg-topbar-title p {
    margin-top: 7px;
    color: var(--rmg-muted);
    font-size: 13px;
    line-height: 1.35;
    font-weight: 400;
}
.rmg-reference-dashboard-shell .rmg-search { width: 100%; max-width: 340px; min-width: 250px; }
.rmg-reference-dashboard-shell .rmg-search .rmg-input {
    height: 49px;
    border: 1px solid rgba(4,51,107,.09);
    border-radius: 13px;
    background: rgba(255,255,255,.74);
    color: var(--rmg-text);
    font-size: 13px;
    box-shadow: 0 7px 20px rgba(4,51,107,.025);
}
.rmg-reference-dashboard-shell .rmg-search .rmg-input:focus { background:#fff; }
.rmg-reference-dashboard-shell .rmg-search > svg { top: 14px; color: var(--rmg-primary); }
.rmg-reference-dashboard-shell .rmg-top-actions { gap: 9px; }
.rmg-reference-dashboard-shell .rmg-top-actions > .rmg-icon-btn {
    width: 43px; height: 43px;
    border: 1px solid rgba(4,51,107,.08);
    background: rgba(255,255,255,.76);
    color: var(--rmg-primary);
    box-shadow: 0 7px 19px rgba(4,51,107,.03);
    transition: transform .22s ease, background .22s ease, box-shadow .22s ease;
}
.rmg-reference-dashboard-shell .rmg-top-actions > .rmg-icon-btn:hover {
    transform: translateY(-2px); background:#fff; box-shadow:0 11px 24px rgba(4,51,107,.07);
}
.rmg-reference-dashboard-shell .rmg-notification-count { background: var(--rmg-primary); font-weight: 500; }
.rmg-reference-dashboard-shell .rmg-user-menu {
    min-width: 235px; max-width: 280px; height: 54px;
    padding: 5px 10px 5px 6px;
    border: 1px solid rgba(4,51,107,.07);
    border-radius: 14px;
    background: rgba(255,255,255,.66);
    box-shadow: 0 7px 20px rgba(4,51,107,.025);
    transition: background .22s ease, box-shadow .22s ease;
}
.rmg-reference-dashboard-shell .rmg-user-menu:hover { background:#fff; box-shadow:0 11px 25px rgba(4,51,107,.06); }
.rmg-reference-dashboard-shell .rmg-profile-avatar {
    width: 42px; height: 42px;
    color:#fff; border:0; background:var(--rmg-premium-blue);
    box-shadow:0 7px 17px rgba(4,51,107,.15);
}
.rmg-reference-dashboard-shell .rmg-user-copy strong { color:var(--rmg-text); font-size:12px; font-weight:500; }
.rmg-reference-dashboard-shell .rmg-user-copy span { color:var(--rmg-muted); font-size:10px; font-weight:400; }
.rmg-reference-dashboard-shell .rmg-user-chevron { color:var(--rmg-primary); }
.rmg-profile-popover {
    border:1px solid rgba(4,51,107,.08);
    border-radius:16px;
    background:rgba(255,255,255,.96);
    box-shadow:0 22px 54px rgba(4,51,107,.14);
    backdrop-filter:blur(16px);
}
.rmg-profile-popover a:hover, .rmg-profile-popover button:hover { background:#F5F8FA; }
.rmg-profile-popover svg { color:var(--rmg-primary); }

/* Content spacing and cards */
.rmg-reference-dashboard-shell .rmg-content { padding: 20px 27px 38px; }
.rmg-card,
.rmg-reference-dashboard-shell .rmg-card {
    border: 1px solid rgba(4,51,107,.075);
    border-radius: var(--rmg-radius,18px);
    background: rgba(255,255,255,.76);
    box-shadow: 0 10px 30px rgba(4,51,107,.035);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform .28s cubic-bezier(.22,1,.36,1), box-shadow .28s ease, border-color .28s ease, background .28s ease;
}
.rmg-card:hover,
.rmg-reference-dashboard-shell .rmg-card:hover {
    transform: translateY(-3px);
    border-color: rgba(4,51,107,.11);
    background: rgba(255,255,255,.92);
    box-shadow: 0 18px 42px rgba(4,51,107,.075);
}

/* Dashboard toolbar */
.rmg-reference-dashboard-shell .rmg-dashboard-toolbar { min-height: 62px; align-items: center; }
.rmg-reference-dashboard-shell .rmg-date-filter {
    min-height: 45px; border-radius: 11px; border-color: rgba(4,51,107,.09);
    background:rgba(255,255,255,.72); color:var(--rmg-primary); font-size:12px; font-weight:500;
    box-shadow:0 6px 18px rgba(4,51,107,.025);
}
.rmg-reference-dashboard-shell .rmg-dashboard-actions .rmg-btn { height:45px; border-radius:11px; font-size:12px; font-weight:500; }
.rmg-reference-dashboard-shell .rmg-export-button { border-color:rgba(4,51,107,.10); background:rgba(255,255,255,.76); color:var(--rmg-primary); }
.rmg-reference-dashboard-shell .rmg-new-order-button { background:var(--rmg-premium-blue); box-shadow:0 10px 22px rgba(4,51,107,.15); }

/* KPI cards */
.rmg-reference-dashboard-shell .rmg-metric-grid { gap: 15px; }
.rmg-reference-dashboard-shell .rmg-metric-card { min-height: 150px; padding: 17px; }
.rmg-reference-dashboard-shell .rmg-metric-main { grid-template-columns: 58px minmax(0,1fr) 92px; gap:13px; }
.rmg-reference-dashboard-shell .rmg-metric-icon {
    width: 55px; height: 55px; border-radius: 15px;
    color:var(--rmg-primary); background:rgba(4,51,107,.055);
    box-shadow:none; transition:transform .25s ease, color .25s ease, background .25s ease;
}
.rmg-reference-dashboard-shell .rmg-metric-card:hover .rmg-metric-icon {
    color:#fff; background:var(--rmg-premium-blue); transform:rotate(-3deg) scale(1.03);
}
.rmg-reference-dashboard-shell .rmg-metric-icon svg { width:25px; height:25px; }
.rmg-reference-dashboard-shell .rmg-metric-label { color:#536270; font-size:13px; font-weight:400; }
.rmg-reference-dashboard-shell .rmg-metric-value { color:var(--rmg-text); font-size:var(--rmg-metric-value-size,32px); font-weight:500; }
.rmg-reference-dashboard-shell .rmg-sparkline path { stroke:var(--rmg-accent); stroke-width:2; }
.rmg-reference-dashboard-shell .rmg-trend b { font-weight:500; }

/* Panels and titles */
.rmg-reference-dashboard-shell .rmg-panel { padding: 19px; }
.rmg-reference-dashboard-shell .rmg-panel-title h2,
.rmg-reference-dashboard-shell .rmg-quick-actions-panel > h2,
.rmg-page-head h2,
.rmg-module-card h3 {
    color:var(--rmg-text);
    font-weight:500;
}
.rmg-reference-dashboard-shell .rmg-panel-title h2,
.rmg-reference-dashboard-shell .rmg-quick-actions-panel > h2 { font-size:max(var(--rmg-section-title-size,18px),17px); }
.rmg-reference-dashboard-shell .rmg-link, .rmg-link { color:var(--rmg-primary); font-weight:500; }
.rmg-reference-dashboard-shell .rmg-period-select { height:38px !important; border-radius:10px; font-weight:400; }
.rmg-reference-dashboard-shell .rmg-chart-grid-line { stroke:#E4EAF0; }
.rmg-reference-dashboard-shell .rmg-chart-bar { fill:var(--rmg-accent); }
.rmg-reference-dashboard-shell .rmg-chart-line { stroke:var(--rmg-primary); stroke-width:2; }
.rmg-reference-dashboard-shell .rmg-chart-point { stroke:var(--rmg-primary); }

/* Action center, activity and quick actions */
.rmg-reference-dashboard-shell .rmg-action-center-icon,
.rmg-reference-dashboard-shell .rmg-activity-icon,
.rmg-reference-dashboard-shell .rmg-document-icon {
    color:var(--rmg-primary); background:rgba(4,51,107,.055);
}
.rmg-reference-dashboard-shell .rmg-action-center-copy strong,
.rmg-reference-dashboard-shell .rmg-item-copy strong { color:var(--rmg-text); font-weight:500; }
.rmg-reference-dashboard-shell .rmg-action-view {
    border-radius:10px; border-color:rgba(4,51,107,.10); background:#fff; color:var(--rmg-primary); font-weight:500;
}
.rmg-reference-dashboard-shell .rmg-quick-actions-panel { border-radius:18px; }
.rmg-reference-dashboard-shell .rmg-quick-action-card {
    border-radius:13px; border-color:rgba(4,51,107,.08); background:rgba(255,255,255,.70);
    transition:transform .24s ease, background .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.rmg-reference-dashboard-shell .rmg-quick-action-card:hover {
    transform:translateY(-3px); background:#fff; border-color:rgba(4,51,107,.12); box-shadow:0 10px 25px rgba(4,51,107,.055);
}
.rmg-reference-dashboard-shell .rmg-quick-action-icon { color:var(--rmg-primary); }
.rmg-reference-dashboard-shell .rmg-quick-action-card strong { color:var(--rmg-text); font-weight:500; }

/* General module pages */
.rmg-page-card { padding: 22px; }
.rmg-page-head { margin-bottom: 21px; align-items: flex-end; }
.rmg-page-head h2 { font-size: 25px; font-weight:500; letter-spacing:-.035em; }
.rmg-page-head p { margin-top:7px; color:var(--rmg-muted); font-size:13px; line-height:1.55; }
.rmg-toolbar { gap:9px; padding:10px; border:1px solid rgba(4,51,107,.055); border-radius:14px; background:rgba(248,250,252,.68); }
.rmg-toolbar .rmg-input, .rmg-toolbar .rmg-select { min-width:190px; height:45px; }
.rmg-module-card { padding:21px; border-radius:18px; }
.rmg-module-card h3 { font-size:17px; }
.rmg-module-card p { color:var(--rmg-muted); font-size:14px; }

/* Tables */
.rmg-table-wrap { border-radius: 14px; }
.rmg-table { background: rgba(255,255,255,.42); }
.rmg-table th {
    padding:13px 10px; color:#788692; background:rgba(4,51,107,.025);
    font-size:11px; font-weight:500; letter-spacing:.05em;
}
.rmg-table td { padding:14px 10px; color:#34495a; font-size:13px; }
.rmg-table tbody tr { transition:background .2s ease; }
.rmg-table tbody tr:hover { background:rgba(11,112,190,.035); }
.rmg-id { color:var(--rmg-primary); font-weight:500; }
.rmg-mini-avatar { background:rgba(4,51,107,.055); color:var(--rmg-primary); font-weight:500; }
.rmg-status { font-weight:500; }

/* Settings */
.rmg-interface-settings-head h2 { color:var(--rmg-text); font-weight:500; }
.rmg-settings-eyebrow { color:var(--rmg-primary); font-weight:500; }
.rmg-settings-panel { border-radius:20px; }
.rmg-settings-panel-head h3 { font-weight:500; color:var(--rmg-text); }
.rmg-settings-panel-head > div > span { color:var(--rmg-primary); font-weight:500; }
.rmg-color-input { border-radius:11px; border-color:rgba(4,51,107,.10); }

/* Modals / toasts */
.rmg-modal-backdrop { background:rgba(2,38,79,.40); backdrop-filter:blur(8px); }
.rmg-modal {
    border:1px solid rgba(4,51,107,.08); border-radius:22px;
    box-shadow:0 34px 82px rgba(2,38,79,.22);
    animation:rmgPremiumModalIn .25s cubic-bezier(.22,1,.36,1) both;
}
.rmg-modal-head h3 { font-weight:500; color:var(--rmg-text); }
.rmg-toast { border-radius:13px; background:var(--rmg-premium-blue); font-size:13px; font-weight:400; }
@keyframes rmgPremiumModalIn { from { opacity:0; transform:translateY(12px) scale(.985); } to { opacity:1; transform:none; } }

/* Dynamic content reveal */
.rmg-premium-reveal {
    opacity:0;
    transform:translateY(14px) scale(.997);
    transition:opacity .56s cubic-bezier(.22,1,.36,1), transform .56s cubic-bezier(.22,1,.36,1);
    transition-delay:var(--rmg-reveal-delay,0ms);
}
.rmg-premium-reveal.is-visible { opacity:1; transform:none; }
body.rmg-animations-disabled .rmg-premium-reveal { opacity:1; transform:none; transition:none; }

/* Responsive layout */
@media (max-width: 1280px) {
    .rmg-reference-dashboard-shell .rmg-topbar { grid-template-columns:minmax(310px,1fr) minmax(230px,300px) auto; padding:0 21px; gap:13px; }
    .rmg-reference-dashboard-shell .rmg-topbar-title h1 { font-size:min(var(--rmg-page-title-size,32px),29px); }
    .rmg-reference-dashboard-shell .rmg-reference-nav { padding-right:4px; }
}
@media (max-width: 1060px) {
    .rmg-reference-dashboard-shell .rmg-sidebar { box-shadow:18px 0 45px rgba(4,51,107,.12); }
    .rmg-reference-dashboard-shell .rmg-topbar { position:sticky !important; height:80px; grid-template-columns:auto minmax(0,1fr) auto; padding:0 16px; }
    .rmg-reference-dashboard-shell .rmg-menu-toggle { display:grid; }
    .rmg-reference-dashboard-shell .rmg-search { display:none; }
    .rmg-reference-dashboard-shell .rmg-user-menu { min-width:0; width:48px; height:48px; padding:3px; border-radius:14px; }
    .rmg-reference-dashboard-shell .rmg-user-copy, .rmg-reference-dashboard-shell .rmg-user-chevron { display:none; }
    .rmg-reference-dashboard-shell .rmg-content { padding:18px 18px 32px; }
}
@media (max-width: 760px) {
    body.rmg-app-page { font-size:15px; }
    .rmg-auth-card { grid-template-columns:1fr; min-height:0; border-radius:22px; }
    .rmg-auth-brand { min-height:330px; padding:30px 24px; }
    .rmg-auth-brand h1 { font-size:38px; }
    .rmg-auth-form-wrap { padding:34px 22px; }
    .rmg-reference-dashboard-shell .rmg-topbar { height:74px; }
    .rmg-reference-dashboard-shell .rmg-topbar-title h1 { max-width:220px; font-size:22px; }
    .rmg-reference-dashboard-shell .rmg-content { padding:14px 12px 28px; }
    .rmg-reference-dashboard-shell .rmg-metric-grid { gap:10px; }
    .rmg-reference-dashboard-shell .rmg-metric-card { min-height:130px; }
    .rmg-reference-dashboard-shell .rmg-dashboard-actions .rmg-btn { padding:0 13px; }
    .rmg-page-card { padding:16px; }
    .rmg-page-head { align-items:flex-start; }
    .rmg-page-head h2 { font-size:22px; }
    .rmg-toolbar { padding:8px; }
    .rmg-toolbar .rmg-input, .rmg-toolbar .rmg-select { width:100%; min-width:0; }
}
@media (max-width: 520px) {
    .rmg-reference-dashboard-shell .rmg-top-actions > .rmg-icon-btn:not(.rmg-menu-toggle) { display:none; }
    .rmg-reference-dashboard-shell .rmg-topbar-title h1 { max-width:175px; font-size:20px; }
    .rmg-reference-dashboard-shell .rmg-dashboard-toolbar { align-items:stretch; }
    .rmg-reference-dashboard-shell .rmg-dashboard-actions { width:100%; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
    .rmg-reference-dashboard-shell .rmg-dashboard-actions .rmg-btn { width:100%; min-width:0; }
}
@media (prefers-reduced-motion: reduce) {
    .rmg-premium-reveal { opacity:1 !important; transform:none !important; transition:none !important; }
}

/* Ensure the default clean theme keeps the light glass sidebar even though the
   legacy gradient-style helper used an !important background. */
body.rmg-app-page.rmg-gradient-clean .rmg-reference-dashboard-shell .rmg-sidebar {
    background: var(--rmg-premium-page-bg) !important;
}


/* ========================================================================== 
   RMG Business Platform v0.8.0 — Light Control Center + Form Studio
   Uses the exact approved website/header background and fixes sidebar contrast.
   ========================================================================== */

:root {
    --rmg-premium-page-bg: linear-gradient(180deg, rgba(250,251,252,.98), rgba(247,249,251,.98));
    --rmg-sidebar-start: #FAFBFC;
    --rmg-sidebar-end: #F7F9FB;
}

html, body.rmg-app-page,
.rmg-reference-dashboard-shell,
.rmg-reference-dashboard-shell .rmg-main,
.rmg-reference-dashboard-shell .rmg-content {
    background: var(--rmg-premium-page-bg) !important;
}

/* Light sidebar — exact theme and corrected contrast. */
body.rmg-app-page .rmg-reference-dashboard-shell .rmg-sidebar,
body.rmg-app-page.rmg-gradient-clean .rmg-reference-dashboard-shell .rmg-sidebar,
body.rmg-app-page.rmg-gradient-deep-ocean .rmg-reference-dashboard-shell .rmg-sidebar {
    background: var(--rmg-premium-page-bg) !important;
    border-right: 1px solid rgba(4,51,107,.08) !important;
    box-shadow: 12px 0 36px rgba(4,51,107,.035) !important;
}
.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-lockup {
    min-height:72px; margin:0 7px 18px; padding:10px 12px;
    border:1px solid rgba(4,51,107,.075); border-radius:18px;
    background:rgba(255,255,255,.78); box-shadow:0 10px 28px rgba(4,51,107,.045);
}
.rmg-reference-dashboard-shell .rmg-sidebar .rmg-brand-logo-image { width:min(100%,220px); max-height:56px; }
.rmg-reference-dashboard-shell .rmg-reference-nav { padding:0 5px 0 0; gap:5px; scrollbar-color:rgba(4,51,107,.20) transparent; }
.rmg-reference-dashboard-shell .rmg-reference-nav::-webkit-scrollbar-track { background:transparent; }
.rmg-reference-dashboard-shell .rmg-reference-nav::-webkit-scrollbar-thumb { background:rgba(4,51,107,.18); }
.rmg-reference-dashboard-shell .rmg-nav-item {
    position:relative; min-height:52px; padding:0 15px; gap:13px; border-radius:13px;
    color:#465563 !important; font-size:var(--rmg-nav-font-size,16px); font-weight:400; letter-spacing:-.015em;
    transition:background .22s ease,color .22s ease,transform .22s ease,box-shadow .22s ease;
}
.rmg-reference-dashboard-shell .rmg-nav-item:hover {
    color:#04336B !important; background:rgba(4,51,107,.045) !important; transform:translateX(2px);
}
.rmg-reference-dashboard-shell .rmg-nav-item.is-active {
    color:#04336B !important; background:rgba(255,255,255,.94) !important;
    box-shadow:0 9px 24px rgba(4,51,107,.075), inset 0 0 0 1px rgba(4,51,107,.075) !important;
    font-weight:500;
}
.rmg-reference-dashboard-shell .rmg-nav-item.is-active::before {
    content:""; position:absolute; left:0; top:12px; bottom:12px; width:3px; border-radius:999px;
    background:linear-gradient(180deg,#0B70BE,#04336B);
}
.rmg-reference-dashboard-shell .rmg-nav-icon { color:#607181 !important; }
.rmg-reference-dashboard-shell .rmg-nav-item:hover .rmg-nav-icon,
.rmg-reference-dashboard-shell .rmg-nav-item.is-active .rmg-nav-icon { color:#04336B !important; }
.rmg-reference-dashboard-shell .rmg-nav-icon svg { width:22px; height:22px; }
.rmg-reference-dashboard-shell .rmg-nav-badge { background:rgba(4,51,107,.07); color:#04336B; font-weight:500; }
.rmg-reference-dashboard-shell .rmg-sidebar-legal,
.rmg-reference-dashboard-shell .rmg-sidebar-legal span { color:#7B8894 !important; font-size:11px; }

/* Topbar becomes a sticky light glass rail matching the website header. */
.rmg-reference-dashboard-shell .rmg-topbar {
    position:sticky !important; top:0; z-index:80; height:auto; min-height:92px;
    padding:13px 26px; background:rgba(250,251,252,.90) !important;
    border-bottom:1px solid rgba(4,51,107,.075); box-shadow:0 8px 25px rgba(4,51,107,.035);
    backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
}
.rmg-reference-dashboard-shell .rmg-topbar-title h1 { color:#131A23; font-size:var(--rmg-page-title-size,34px); font-weight:500; letter-spacing:-.04em; }
.rmg-reference-dashboard-shell .rmg-topbar-title p { color:#66758A; font-size:13px; line-height:1.45; }
.rmg-reference-dashboard-shell .rmg-search .rmg-input,
.rmg-reference-dashboard-shell .rmg-top-actions > .rmg-icon-btn,
.rmg-reference-dashboard-shell .rmg-user-menu {
    border:1px solid rgba(4,51,107,.08); background:rgba(255,255,255,.78); box-shadow:0 7px 20px rgba(4,51,107,.03);
}
.rmg-reference-dashboard-shell .rmg-user-menu { border-radius:14px; padding:5px 8px; }
.rmg-reference-dashboard-shell .rmg-user-menu:hover { background:#fff; }
.rmg-reference-dashboard-shell .rmg-profile-avatar { background:rgba(4,51,107,.055); color:#04336B; border-color:rgba(4,51,107,.07); }
.rmg-reference-dashboard-shell .rmg-user-copy strong { color:#213548; font-size:12.5px; font-weight:500; }
.rmg-reference-dashboard-shell .rmg-user-copy span { color:#7B8894; font-size:11px; }

/* Cards and content hierarchy. */
.rmg-reference-dashboard-shell .rmg-content { padding:20px 26px 38px; }
.rmg-reference-dashboard-shell .rmg-card,
.rmg-card {
    border-color:rgba(4,51,107,.075); background:rgba(255,255,255,.76);
    box-shadow:0 12px 32px rgba(4,51,107,.035); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
}
.rmg-reference-dashboard-shell .rmg-card:hover { box-shadow:0 17px 38px rgba(4,51,107,.055); }
.rmg-reference-dashboard-shell .rmg-metric-card { border-radius:20px; }
.rmg-reference-dashboard-shell .rmg-dashboard-primary > .rmg-card,
.rmg-reference-dashboard-shell .rmg-dashboard-lower > .rmg-card { border-radius:20px; }
.rmg-reference-dashboard-shell .rmg-metric-label { color:#536270; font-size:14px; }
.rmg-reference-dashboard-shell .rmg-metric-value { font-weight:500; }
.rmg-reference-dashboard-shell .rmg-quick-actions-list { grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); }
.rmg-reference-dashboard-shell .rmg-quick-action-card { min-height:96px; }
.rmg-reference-dashboard-shell .rmg-quick-action-card strong { font-size:13.5px; }

/* ----------------------------------------------------------
   FORM STUDIO
---------------------------------------------------------- */
.rmg-form-studio { display:grid; gap:28px; padding-bottom:90px; }
.rmg-form-studio-loading { min-height:280px; display:grid; place-items:center; align-content:center; gap:12px; color:#66758A; }
.rmg-studio-hero {
    position:relative; overflow:hidden; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:28px; align-items:end;
    padding:30px; border:1px solid rgba(4,51,107,.075); border-radius:24px; background:rgba(255,255,255,.72);
    box-shadow:0 16px 42px rgba(4,51,107,.055);
}
.rmg-studio-hero::after { content:""; position:absolute; width:300px; height:300px; right:-170px; top:-180px; border-radius:50%; background:radial-gradient(circle,rgba(11,112,190,.10),transparent 70%); pointer-events:none; }
.rmg-studio-hero > * { position:relative; z-index:2; }
.rmg-studio-eyebrow { display:block; margin-bottom:10px; color:#04336B; font-size:11px; font-weight:500; letter-spacing:.10em; }
.rmg-studio-hero h2 { max-width:760px; margin:0 0 12px; color:#131A23; font-size:clamp(30px,3.2vw,46px); line-height:1.12; font-weight:500; letter-spacing:-.045em; }
.rmg-studio-hero p { max-width:760px; margin:0; color:#526370; font-size:15px; line-height:1.7; }
.rmg-studio-hero-actions { display:flex; gap:9px; align-items:center; }

.rmg-studio-overview-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(320px,.7fr); gap:20px; }
.rmg-studio-preview-card,.rmg-studio-publish-card,.rmg-studio-panel,.rmg-studio-config-card,.rmg-studio-entity-card {
    border:1px solid rgba(4,51,107,.075); background:rgba(255,255,255,.76); border-radius:20px;
    box-shadow:0 12px 32px rgba(4,51,107,.035);
}
.rmg-studio-preview-card { padding:12px; }
.rmg-studio-preview-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:7px 9px 13px; }
.rmg-studio-preview-head span { color:#04336B; font-size:12px; font-weight:500; }
.rmg-studio-preview-head i { color:#7B8894; font-size:11px; font-style:normal; }
.rmg-studio-preview-shell { position:relative; overflow:hidden; min-height:350px; padding:29px; border-radius:16px; background:linear-gradient(180deg,rgba(250,251,252,.98),rgba(247,249,251,.98)); border:1px solid rgba(4,51,107,.06); }
.rmg-studio-preview-shell::after { content:""; position:absolute; width:250px; height:250px; right:-140px; top:-150px; border-radius:50%; background:radial-gradient(circle,rgba(11,112,190,.09),transparent 70%); }
.rmg-studio-preview-shell > * { position:relative; z-index:2; }
.rmg-studio-preview-kicker { color:#04336B; font-size:10px; font-weight:500; letter-spacing:.10em; text-transform:uppercase; }
.rmg-studio-preview-shell h3 { margin:11px 0 8px; color:#131A23; font-size:29px; font-weight:500; letter-spacing:-.04em; }
.rmg-studio-preview-shell > p { max-width:620px; margin:0; color:#66758A; font-size:13px; line-height:1.6; }
.rmg-studio-preview-steps { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; margin:24px 0 18px; }
.rmg-studio-preview-steps span { min-width:0; display:grid; gap:5px; }
.rmg-studio-preview-steps b { width:25px; height:25px; display:grid; place-items:center; border-radius:50%; background:rgba(4,51,107,.06); color:#04336B; font-size:9px; font-weight:500; }
.rmg-studio-preview-steps span:first-child b { color:#fff; background:linear-gradient(145deg,#0B70BE,#04336B); }
.rmg-studio-preview-steps small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#788692; font-size:9px; }
.rmg-studio-preview-fields { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.rmg-studio-preview-fields span { min-height:49px; display:flex; align-items:center; padding:0 14px; border:1px solid rgba(4,51,107,.10); border-radius:11px; background:#fff; color:#788692; font-size:11px; }
.rmg-studio-preview-shell > button { width:100%; min-height:50px; margin-top:11px; padding:0 13px 0 17px; display:flex; justify-content:space-between; align-items:center; border:0; border-radius:11px; color:#fff; background:linear-gradient(135deg,#0768A8,#04336B 64%,#02264F); font:500 12px var(--rmg-font-family); }
.rmg-studio-preview-shell > button svg { width:17px; height:17px; }

.rmg-studio-publish-card { padding:24px; }
.rmg-studio-publish-card h3 { margin:0 0 9px; color:#131A23; font-size:22px; font-weight:500; letter-spacing:-.03em; }
.rmg-studio-publish-card > p { margin:0 0 18px; color:#66758A; font-size:13px; line-height:1.65; }
.rmg-studio-code { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:center; margin-top:9px; padding:8px 9px 8px 13px; border:1px solid rgba(4,51,107,.075); border-radius:11px; background:rgba(4,51,107,.025); }
.rmg-studio-code code { overflow:hidden; text-overflow:ellipsis; color:#04336B; font-size:12px; }
.rmg-studio-code button { min-height:34px; padding:0 11px; border:1px solid rgba(4,51,107,.08); border-radius:8px; background:#fff; color:#04336B; font:500 10px var(--rmg-font-family); cursor:pointer; }
.rmg-studio-health { display:flex; gap:11px; align-items:flex-start; margin-top:18px; padding:14px; border-radius:13px; background:rgba(52,147,99,.055); }
.rmg-studio-health > i { width:9px; height:9px; margin-top:4px; flex:0 0 9px; border-radius:50%; background:#55A87B; box-shadow:0 0 0 4px rgba(85,168,123,.09); }
.rmg-studio-health span { display:grid; gap:3px; }
.rmg-studio-health strong { color:#315B47; font-size:12px; font-weight:500; }
.rmg-studio-health small { color:#6E8379; font-size:10.5px; line-height:1.45; }

.rmg-studio-section { display:grid; gap:14px; }
.rmg-studio-section-head { display:grid; grid-template-columns:minmax(0,1fr) minmax(260px,.55fr); gap:26px; align-items:end; }
.rmg-studio-section-head > div { display:flex; align-items:center; gap:10px; }
.rmg-studio-section-head > div > span { width:29px; height:29px; display:grid; place-items:center; border-radius:9px; background:rgba(4,51,107,.055); color:#04336B; font-size:10px; font-weight:500; }
.rmg-studio-section-head h3 { margin:0; color:#131A23; font-size:20px; font-weight:500; letter-spacing:-.025em; }
.rmg-studio-section-head p { margin:0; color:#7B8894; font-size:12px; line-height:1.5; text-align:right; }
.rmg-studio-panel { padding:22px; }
.rmg-studio-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
.rmg-studio-textarea { min-height:88px !important; height:auto !important; padding-top:12px; resize:vertical; line-height:1.55; }
.rmg-studio-step-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:9px; margin-top:15px; }
.rmg-studio-step-grid .rmg-field label { font-size:11px; }
.rmg-studio-two-col { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.rmg-studio-switch-panel { display:grid; gap:4px; align-content:start; }
.rmg-studio-switch-row { min-height:66px; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:10px 4px; border-bottom:1px solid rgba(4,51,107,.065); }
.rmg-studio-switch-row:last-of-type { border-bottom:0; }
.rmg-studio-switch-row > span:first-child { display:grid; gap:4px; }
.rmg-studio-switch-row strong { color:#314659; font-size:13px; font-weight:500; }
.rmg-studio-switch-row small { color:#7B8894; font-size:10.5px; line-height:1.4; }
.rmg-studio-switch { position:relative; width:42px; height:24px; flex:0 0 42px; }
.rmg-studio-switch input { position:absolute; opacity:0; pointer-events:none; }
.rmg-studio-switch i { position:absolute; inset:0; border-radius:999px; background:#D8E0E7; transition:.22s; }
.rmg-studio-switch i::after { content:""; position:absolute; width:18px; height:18px; left:3px; top:3px; border-radius:50%; background:#fff; box-shadow:0 2px 7px rgba(31,51,70,.16); transition:.22s; }
.rmg-studio-switch input:checked + i { background:#04336B; }
.rmg-studio-switch input:checked + i::after { transform:translateX(18px); }
.rmg-studio-callout { display:flex; gap:11px; align-items:flex-start; margin-top:12px; padding:14px; border-radius:13px; background:rgba(4,51,107,.035); }
.rmg-studio-callout > span { width:35px; height:35px; display:grid; place-items:center; flex:0 0 35px; border-radius:10px; color:#04336B; background:#fff; }
.rmg-studio-callout svg { width:18px; height:18px; }
.rmg-studio-callout strong { display:block; color:#314659; font-size:12px; font-weight:500; }
.rmg-studio-callout p { margin:4px 0 0; color:#7B8894; font-size:10.5px; line-height:1.5; }

.rmg-studio-entity-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.rmg-studio-entity-card { padding:15px; }
.rmg-studio-card-top { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px; }
.rmg-studio-mini-code { display:inline-flex; min-height:27px; align-items:center; padding:0 9px; border-radius:999px; background:rgba(4,51,107,.05); color:#04336B; font-size:9px; font-weight:500; text-transform:uppercase; }
.rmg-studio-config-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.rmg-studio-addon-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.rmg-studio-config-card { padding:18px; transition:transform .25s ease,box-shadow .25s ease; }
.rmg-studio-config-card:hover { transform:translateY(-3px); box-shadow:0 17px 38px rgba(4,51,107,.055); }
.rmg-studio-config-head { display:flex; align-items:center; justify-content:space-between; gap:13px; padding-bottom:14px; margin-bottom:15px; border-bottom:1px solid rgba(4,51,107,.065); }
.rmg-studio-config-head > div > span { color:#04336B; font-size:9px; font-weight:500; letter-spacing:.08em; text-transform:uppercase; }
.rmg-studio-config-head h3 { margin:4px 0 0; color:#24394B; font-size:16px; font-weight:500; }
.rmg-studio-subsection { display:grid; gap:13px; margin-top:15px; padding-top:13px; border-top:1px solid rgba(4,51,107,.065); }
.rmg-studio-sub-label { display:block; margin-bottom:7px; color:#536270; font-size:11px; font-weight:500; }
.rmg-studio-chip-grid { display:flex; flex-wrap:wrap; gap:6px; }
.rmg-studio-chip-check { position:relative; cursor:pointer; }
.rmg-studio-chip-check input { position:absolute; opacity:0; pointer-events:none; }
.rmg-studio-chip-check span { min-height:30px; display:inline-flex; align-items:center; padding:0 9px; border:1px solid rgba(4,51,107,.08); border-radius:999px; background:#fff; color:#66758A; font-size:9px; transition:.2s; }
.rmg-studio-chip-check input:checked + span { color:#04336B; border-color:rgba(4,51,107,.18); background:rgba(4,51,107,.055); box-shadow:inset 0 0 0 1px rgba(4,51,107,.035); }
.rmg-studio-inline-switches { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:15px; }
.rmg-studio-inline-switches .rmg-studio-switch-row { padding:11px 13px; border:1px solid rgba(4,51,107,.065); border-radius:13px; background:rgba(248,250,252,.58); }

.rmg-studio-savebar { position:sticky; bottom:14px; z-index:30; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:12px 13px 12px 17px; border:1px solid rgba(4,51,107,.08); border-radius:15px; background:rgba(255,255,255,.90); box-shadow:0 15px 40px rgba(4,51,107,.12); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); }
.rmg-studio-savebar > div { display:grid; gap:2px; }
.rmg-studio-savebar strong { color:#24394B; font-size:12px; font-weight:500; }
.rmg-studio-savebar span { color:#7B8894; font-size:10.5px; }

@media (max-width:1180px) {
    .rmg-studio-overview-grid,.rmg-studio-section-head { grid-template-columns:1fr; }
    .rmg-studio-section-head p { text-align:left; }
    .rmg-studio-config-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .rmg-studio-entity-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .rmg-studio-step-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:760px) {
    .rmg-studio-hero { grid-template-columns:1fr; padding:22px; }
    .rmg-studio-hero-actions { flex-wrap:wrap; }
    .rmg-studio-hero-actions .rmg-btn { flex:1 1 150px; }
    .rmg-studio-two-col,.rmg-studio-form-grid,.rmg-studio-config-grid,.rmg-studio-addon-grid,.rmg-studio-inline-switches { grid-template-columns:1fr; }
    .rmg-studio-step-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .rmg-studio-preview-steps { grid-template-columns:repeat(5,minmax(55px,1fr)); overflow-x:auto; padding-bottom:5px; }
    .rmg-studio-preview-shell { padding:20px; }
    .rmg-studio-preview-shell h3 { font-size:25px; }
    .rmg-studio-savebar { bottom:8px; }
}
@media (max-width:520px) {
    .rmg-studio-entity-grid,.rmg-studio-step-grid { grid-template-columns:1fr; }
    .rmg-studio-preview-fields { grid-template-columns:1fr; }
    .rmg-studio-savebar { align-items:stretch; flex-direction:column; }
    .rmg-studio-savebar .rmg-btn { width:100%; }
}

/* =========================================================
   v0.8 FORM CONTROL CENTER — DASHBOARD
========================================================= */
.rmg-form-control-center{
    position:relative;
    overflow:hidden;
    display:grid;
    grid-template-columns:minmax(0,1.18fr) minmax(360px,.82fr);
    gap:clamp(28px,4vw,58px);
    align-items:center;
    margin:14px 0 22px;
    padding:clamp(26px,3vw,38px)!important;
    background:linear-gradient(145deg,rgba(255,255,255,.97),rgba(247,250,252,.92))!important;
    border:1px solid rgba(4,51,107,.08)!important;
    border-radius:22px!important;
    box-shadow:0 18px 50px rgba(4,51,107,.065)!important;
}
.rmg-form-control-center::before{
    content:"";
    position:absolute;
    width:360px;
    height:360px;
    right:-180px;
    top:-210px;
    border-radius:50%;
    background:radial-gradient(circle,rgba(11,112,190,.10),transparent 70%);
    pointer-events:none;
}
.rmg-form-control-copy,.rmg-form-control-status{position:relative;z-index:1;min-width:0}
.rmg-form-control-kicker{
    display:inline-flex;
    align-items:center;
    gap:9px;
    margin-bottom:10px;
    color:#04336B;
    font-size:11px;
    font-weight:500;
    letter-spacing:.09em;
    text-transform:uppercase;
}
.rmg-form-control-kicker::before{content:"";width:24px;height:2px;border-radius:99px;background:linear-gradient(90deg,#0B70BE,#04336B)}
.rmg-form-control-copy h2{max-width:690px;margin:0 0 10px;color:#131A23;font-size:clamp(25px,2.1vw,34px);line-height:1.18;font-weight:500;letter-spacing:-.035em}
.rmg-form-control-copy p{max-width:760px;margin:0;color:#536575;font-size:14px;line-height:1.72;font-weight:400}
.rmg-form-control-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:20px}
.rmg-form-control-actions .rmg-btn{min-height:43px;border-radius:11px;font-size:12px;font-weight:500}
.rmg-form-control-actions svg{width:16px;height:16px}
.rmg-form-control-status{
    padding:19px;
    background:rgba(250,252,253,.88);
    border:1px solid rgba(4,51,107,.08);
    border-radius:18px;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 10px 28px rgba(4,51,107,.035);
}
.rmg-form-control-status-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:15px;color:#536575;font-size:11px;font-weight:500;text-transform:uppercase;letter-spacing:.06em}
.rmg-form-control-status-head b{display:inline-flex;align-items:center;gap:7px;padding:7px 9px;color:#39765A;background:rgba(74,151,108,.07);border:1px solid rgba(74,151,108,.12);border-radius:99px;font-size:9px;font-weight:500;letter-spacing:.04em}
.rmg-form-control-status-head b i{width:6px;height:6px;border-radius:50%;background:#55A87B;box-shadow:0 0 0 4px rgba(85,168,123,.08)}
.rmg-form-control-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.rmg-form-control-metrics>div{min-width:0;padding:12px 10px;background:#fff;border:1px solid rgba(4,51,107,.065);border-radius:12px}
.rmg-form-control-metrics span,.rmg-form-control-metrics small{display:block;color:#7B8792;font-size:9px;font-weight:400}
.rmg-form-control-metrics strong{display:block;margin:2px 0;color:#04336B;font-size:23px;line-height:1.1;font-weight:500}
.rmg-form-control-capabilities{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.rmg-form-control-capabilities span{padding:6px 8px;color:#526370;background:rgba(4,51,107,.04);border:1px solid rgba(4,51,107,.055);border-radius:8px;font-size:9px;font-weight:400}
@media(max-width:980px){.rmg-form-control-center{grid-template-columns:1fr}.rmg-form-control-status{max-width:700px}}
@media(max-width:620px){.rmg-form-control-center{margin:10px 0 18px;padding:20px 15px!important;border-radius:18px!important}.rmg-form-control-copy h2{font-size:26px}.rmg-form-control-copy p{font-size:13px}.rmg-form-control-actions{display:grid;grid-template-columns:1fr}.rmg-form-control-actions .rmg-btn{width:100%}.rmg-form-control-status{padding:13px}.rmg-form-control-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}


/* =========================================================
   v0.8.1 SERVICE + PRICING CONTROL CENTER
========================================================= */
.rmg-service-control-page,.rmg-pricing-manager{display:grid;gap:20px;}
.rmg-control-hero{position:relative;overflow:hidden;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:32px;align-items:center;padding:26px 28px;border:1px solid rgba(4,51,107,.075);border-radius:20px;background:linear-gradient(180deg,rgba(250,251,252,.98),rgba(247,249,251,.98));box-shadow:0 14px 38px rgba(4,51,107,.045);}
.rmg-control-hero::after{content:"";position:absolute;width:280px;height:280px;right:-155px;top:-175px;border-radius:50%;background:radial-gradient(circle,rgba(11,112,190,.09),transparent 70%);pointer-events:none;}
.rmg-control-hero>*{position:relative;z-index:2;}.rmg-control-eyebrow{display:block;margin-bottom:8px;color:#04336B;font-size:10px;font-weight:500;letter-spacing:.11em;}.rmg-control-hero h2{margin:0 0 8px;color:#131A23;font-size:clamp(28px,2.8vw,40px);line-height:1.13;font-weight:500;letter-spacing:-.04em;}.rmg-control-hero p{max-width:760px;margin:0;color:#66758A;font-size:13px;line-height:1.65;}.rmg-control-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;}
.rmg-control-linkbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.rmg-control-linkbar>a{min-height:76px;display:grid;grid-template-columns:42px minmax(0,1fr) 28px;gap:12px;align-items:center;padding:13px 15px;border:1px solid rgba(4,51,107,.07);border-radius:15px;background:rgba(255,255,255,.72);color:#314659;box-shadow:0 8px 24px rgba(4,51,107,.03);transition:.25s}.rmg-control-linkbar>a:hover{transform:translateY(-2px);border-color:rgba(4,51,107,.14);box-shadow:0 13px 30px rgba(4,51,107,.055)}.rmg-control-linkbar>a>span{width:40px;height:40px;display:grid;place-items:center;color:#04336B;background:rgba(4,51,107,.05);border-radius:11px}.rmg-control-linkbar svg{width:19px;height:19px}.rmg-control-linkbar strong{display:block;color:#24394B;font-size:13px;font-weight:500}.rmg-control-linkbar small{display:block;margin-top:3px;color:#7B8894;font-size:10px}.rmg-control-linkbar b{width:27px;height:27px;display:grid;place-items:center;border-radius:50%;background:rgba(4,51,107,.045);color:#04336B;font-size:10px;font-weight:500}
.rmg-pricing-status-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.rmg-pricing-status-grid article{min-height:78px;display:flex;align-items:center;gap:12px;padding:14px;border:1px solid rgba(4,51,107,.07);border-radius:15px;background:rgba(255,255,255,.7)}.rmg-pricing-status-grid article>span{width:40px;height:40px;display:grid;place-items:center;flex:0 0 40px;border-radius:11px;color:#04336B;background:rgba(4,51,107,.05)}.rmg-pricing-status-grid svg{width:19px;height:19px}.rmg-pricing-status-grid small{display:block;color:#7B8894;font-size:9px;text-transform:uppercase;letter-spacing:.06em}.rmg-pricing-status-grid strong{display:block;margin-top:3px;color:#314659;font-size:12px;font-weight:500}
.rmg-pricing-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(270px,.55fr);gap:16px}.rmg-pricing-live-preview{position:relative;overflow:hidden;padding:23px;border:1px solid rgba(4,51,107,.075);border-radius:18px;color:#fff;background:linear-gradient(135deg,#075B96,#04336B 62%,#02264F);box-shadow:0 18px 42px rgba(4,51,107,.14)}.rmg-pricing-live-preview::after{content:"";position:absolute;width:200px;height:200px;right:-115px;top:-120px;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.16),transparent 70%)}.rmg-pricing-live-preview>*{position:relative;z-index:2}.rmg-pricing-live-preview>span{display:block;color:rgba(255,255,255,.64);font-size:9px;font-weight:500;letter-spacing:.11em}.rmg-pricing-live-preview h3{margin:11px 0 8px;color:#fff;font-size:24px;font-weight:500;letter-spacing:-.035em}.rmg-pricing-live-preview p{margin:0 0 18px;color:rgba(255,255,255,.74);font-size:11px;line-height:1.6}.rmg-pricing-live-preview>div{display:grid;gap:4px;padding:12px;border:1px solid rgba(255,255,255,.12);border-radius:12px;background:rgba(255,255,255,.07)}.rmg-pricing-live-preview b{font-size:12px;font-weight:500}.rmg-pricing-live-preview small{color:rgba(255,255,255,.66);font-size:9px}.rmg-pricing-live-preview>a{display:inline-flex;margin-top:16px;color:#fff;font-size:11px;font-weight:500}
.rmg-pricing-section{display:grid;gap:14px}.rmg-pricing-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px}.rmg-pricing-section-head>div{display:flex;align-items:flex-start;gap:10px}.rmg-pricing-section-head>div>span{width:30px;height:30px;display:grid;place-items:center;flex:0 0 30px;border-radius:9px;background:rgba(4,51,107,.055);color:#04336B;font-size:10px;font-weight:500}.rmg-pricing-section-head h3{margin:0;color:#24394B;font-size:20px;font-weight:500;letter-spacing:-.025em}.rmg-pricing-section-head p{margin:4px 0 0;color:#7B8894;font-size:11px;line-height:1.5}.rmg-pricing-section-head>a{color:#04336B;font-size:10px;font-weight:500;white-space:nowrap}
.rmg-pricing-manager-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.rmg-pricing-manager-card{padding:18px;border:1px solid rgba(4,51,107,.07);border-radius:18px;background:rgba(255,255,255,.78);box-shadow:0 10px 28px rgba(4,51,107,.035);transition:.25s}.rmg-pricing-manager-card:hover{transform:translateY(-3px);box-shadow:0 17px 38px rgba(4,51,107,.06)}.rmg-pricing-manager-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;padding-bottom:13px;border-bottom:1px solid rgba(4,51,107,.065)}.rmg-pricing-manager-card-head span{display:block;color:#04336B;font-size:9px;font-weight:500;text-transform:uppercase;letter-spacing:.08em}.rmg-pricing-manager-card-head h3{margin:4px 0 0;color:#24394B;font-size:18px;font-weight:500}.rmg-pricing-manager-price{margin-bottom:15px;padding:14px;border-radius:13px;background:linear-gradient(180deg,rgba(250,251,252,.98),rgba(247,249,251,.98));border:1px solid rgba(4,51,107,.06)}.rmg-pricing-manager-price>label{display:flex;justify-content:space-between;margin-bottom:7px;color:#66758A;font-size:10px;font-weight:500}.rmg-pricing-manager-price>label small{font-size:9px;color:#8A96A0}.rmg-pricing-manager-price>div{display:flex;align-items:center;gap:6px;color:#04336B}.rmg-pricing-manager-price>div>span{font-size:20px;font-weight:500}.rmg-pricing-manager-price input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:#131A23;font:500 29px/1 var(--rmg-font-family)}.rmg-pricing-feature-editor{min-height:128px!important;height:auto!important;padding:12px!important;resize:vertical;line-height:1.55!important}
.rmg-pricing-addon-list{padding:8px 18px}.rmg-pricing-addon-row{display:grid;grid-template-columns:45px minmax(0,1fr) 130px;gap:14px;align-items:center;min-height:76px;padding:11px 2px;border-bottom:1px solid rgba(4,51,107,.065)}.rmg-pricing-addon-row:last-child{border-bottom:0}.rmg-pricing-addon-row strong{display:block;color:#314659;font-size:13px;font-weight:500}.rmg-pricing-addon-row small{display:block;margin-top:4px;color:#7B8894;font-size:10px;line-height:1.45}.rmg-pricing-addon-price{display:flex;align-items:center;gap:5px;padding:8px 10px;border:1px solid rgba(4,51,107,.075);border-radius:10px;background:#fff;color:#04336B}.rmg-pricing-addon-price span{font-size:12px;font-weight:500}.rmg-pricing-addon-price input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:#24394B;font:500 16px var(--rmg-font-family);text-align:right}.rmg-pricing-toggle-stack{margin-top:14px}
@media(max-width:1050px){.rmg-control-hero{grid-template-columns:1fr}.rmg-control-actions{justify-content:flex-start}.rmg-pricing-layout{grid-template-columns:1fr}.rmg-pricing-manager-grid{grid-template-columns:1fr 1fr}.rmg-pricing-status-grid{grid-template-columns:1fr}.rmg-pricing-live-preview{min-height:220px}}
@media(max-width:720px){.rmg-control-hero{padding:21px 18px}.rmg-control-linkbar{grid-template-columns:1fr}.rmg-pricing-manager-grid{grid-template-columns:1fr}.rmg-pricing-section-head{align-items:flex-start;flex-direction:column}.rmg-pricing-addon-row{grid-template-columns:40px minmax(0,1fr);gap:10px}.rmg-pricing-addon-price{grid-column:2}.rmg-control-actions{display:grid;grid-template-columns:1fr;width:100%}.rmg-control-actions .rmg-btn{width:100%;justify-content:center}}
