/* ═══════════════════════════════════════════════════════════════
   RENTAL GATES — Core Design System
   Version: 2.44.0
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Noto+Kufi+Arabic:wght@300;400;500;600;700&display=swap');

/* ── Reset ── */
*,*::before,*::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { line-height: 1.5; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rg-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--rg-border-active); }

/* ═══════════════════════════════════════════
   DESIGN TOKENS — Light Theme (Default)
   ═══════════════════════════════════════════ */
:root,
.rg-theme-light {
    /* Surfaces */
    --rg-bg-base: #f8f9fc;
    --rg-bg-surface: #ffffff;
    --rg-bg-card: #ffffff;
    --rg-bg-elevated: #f1f3f9;
    --rg-bg-hover: #eef1f8;
    --rg-bg-overlay: rgba(0, 0, 0, 0.45);

    /* Borders */
    --rg-border: rgba(15, 23, 42, 0.08);
    --rg-border-active: rgba(15, 23, 42, 0.15);

    /* Text */
    --rg-text-primary: #0f172a;
    --rg-text-secondary: #475569;
    --rg-text-muted: #94a3b8;

    /* Accents */
    --rg-accent-emerald: #10b981;
    --rg-accent-emerald-hover: #059669;
    --rg-accent-blue: #3b82f6;
    --rg-accent-violet: #8b5cf6;
    --rg-accent-amber: #f59e0b;
    --rg-accent-rose: #f43f5e;
    --rg-accent-cyan: #06b6d4;
    --rg-accent-red: #ef4444;

    /* Chart grid */
    --rg-grid: rgba(15, 23, 42, 0.06);

    /* Shadows */
    --rg-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --rg-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --rg-shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.08);
    --rg-shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.15);

    /* Focus ring */
    --rg-focus-ring: 0 0 0 3px rgba(16, 185, 129, 0.15);

    /* Radii */
    --rg-radius-sm: 6px;
    --rg-radius-md: 8px;
    --rg-radius-lg: 10px;
    --rg-radius-xl: 14px;
    --rg-radius-2xl: 16px;

    /* Sidebar */
    --rg-sidebar-width: 260px;

    /* Transitions */
    --rg-transition-fast: 0.15s ease;
    --rg-transition-base: 0.2s ease;
    --rg-transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════
   DESIGN TOKENS — Dark Theme
   ═══════════════════════════════════════════ */
.rg-theme-dark {
    --rg-bg-base: #0a0f1a;
    --rg-bg-surface: #0f1629;
    --rg-bg-card: #111827;
    --rg-bg-elevated: #151d33;
    --rg-bg-hover: #1a2340;
    --rg-bg-overlay: rgba(0, 0, 0, 0.7);

    --rg-border: rgba(148, 163, 184, 0.08);
    --rg-border-active: rgba(148, 163, 184, 0.18);

    --rg-text-primary: #f1f5f9;
    --rg-text-secondary: #94a3b8;
    --rg-text-muted: #64748b;

    --rg-grid: rgba(148, 163, 184, 0.06);

    --rg-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --rg-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --rg-shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.3);
    --rg-shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.5);
}

/* ═══════════════════════════════════════════
   KEYFRAMES
   ═══════════════════════════════════════════ */
@keyframes rg-fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes rg-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes rg-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@keyframes rg-modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes rg-modalSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rg-toastSlide {
    from { opacity: 0; transform: translateY(-12px) translateX(12px); }
    to { opacity: 1; transform: translateY(0) translateX(0); }
}
[dir="rtl"] .rg-toast-container {
    animation-name: rg-toastSlideRTL;
}
@keyframes rg-toastSlideRTL {
    from { opacity: 0; transform: translateY(-12px) translateX(-12px); }
    to { opacity: 1; transform: translateY(0) translateX(0); }
}
@keyframes rg-barGrow {
    from { width: 0; }
}

/* ═══════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════ */
.rg-app {
    display: flex;
    height: 100%;
    background: var(--rg-bg-base);
    color: var(--rg-text-primary);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}
[dir="rtl"] .rg-app {
    font-family: 'Noto Kufi Arabic', 'DM Sans', -apple-system, sans-serif;
}

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */
.rg-sidebar {
    width: var(--rg-sidebar-width);
    background: var(--rg-bg-surface);
    border-inline-end: 1px solid var(--rg-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    height: 100vh;
    z-index: 50;
    overflow: hidden;
    transition: width var(--rg-transition-slow);
}
.rg-sidebar-brand {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--rg-border);
    min-height: 68px;
    flex-shrink: 0;
}
.rg-sidebar-brand-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.25);
    color: #fff;
}
.rg-sidebar-brand-text {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--rg-text-primary);
}
.rg-sidebar-brand-tag {
    font-size: 10px;
    font-weight: 600;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.15);
    letter-spacing: 0.04em;
}

/* Sidebar Nav */
.rg-sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
    overflow-x: hidden;
}
.rg-sidebar-nav::-webkit-scrollbar { width: 3px; }
.rg-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.15); border-radius: 3px; }

.rg-nav-section {
    padding: 18px 12px 6px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rg-text-muted);
}
.rg-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--rg-radius-md);
    cursor: pointer;
    color: var(--rg-text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--rg-transition-fast);
    margin-bottom: 2px;
    position: relative;
    user-select: none;
}
.rg-nav-item:hover {
    background: var(--rg-bg-hover);
    color: var(--rg-text-primary);
}
.rg-nav-item.active {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
}
.rg-nav-item.active::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: #10b981;
    border-start-start-radius: 0;
    border-start-end-radius: 3px;
    border-end-end-radius: 3px;
    border-end-start-radius: 0;
}
.rg-nav-item-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rg-nav-item-icon svg { width: 18px; height: 18px; }
.rg-nav-badge {
    margin-inline-start: auto;
    background: var(--rg-bg-elevated);
    color: var(--rg-text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 5px;
    min-width: 20px;
    text-align: center;
}
.rg-nav-item.active .rg-nav-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* Sidebar Bottom */
.rg-sidebar-bottom {
    padding: 10px;
    border-top: 1px solid var(--rg-border);
    flex-shrink: 0;
}
.rg-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--rg-radius-md);
    cursor: pointer;
    transition: background var(--rg-transition-fast);
}
.rg-sidebar-user:hover { background: var(--rg-bg-hover); }
.rg-sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--rg-radius-md);
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}
.rg-sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--rg-text-primary); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg-sidebar-user-role { font-size: 11px; color: var(--rg-text-muted); }
.rg-sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--rg-radius-md);
    color: var(--rg-text-muted);
    text-decoration: none;
    flex-shrink: 0;
    transition: background var(--rg-transition-fast), color var(--rg-transition-fast);
}
.rg-sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ═══════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════ */
.rg-main {
    flex: 1;
    margin-inline-start: var(--rg-sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: margin var(--rg-transition-slow);
}

/* ═══════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════ */
.rg-topbar {
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--rg-border);
    background: var(--rg-bg-base);
    flex-shrink: 0;
    z-index: 40;
    gap: 16px;
}
.rg-topbar-title {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--rg-text-primary);
}
.rg-topbar-sub {
    font-size: 13px;
    color: var(--rg-text-muted);
}
.rg-topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Search Bar */
.rg-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--rg-bg-surface);
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius-md);
    padding: 7px 14px;
    width: 240px;
    transition: all var(--rg-transition-base);
}
.rg-search-bar:focus-within {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: var(--rg-focus-ring);
}
.rg-search-bar input {
    background: none;
    border: none;
    outline: none;
    color: var(--rg-text-primary);
    font-size: 13px;
    width: 100%;
}
.rg-search-bar input::placeholder { color: var(--rg-text-muted); }
.rg-search-key {
    font-size: 10px;
    color: var(--rg-text-muted);
    background: var(--rg-bg-elevated);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--rg-border);
    font-weight: 500;
    white-space: nowrap;
}

/* Topbar Buttons */
.rg-tb-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--rg-radius-md);
    border: 1px solid var(--rg-border);
    background: transparent;
    color: var(--rg-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--rg-transition-fast);
    position: relative;
}
.rg-tb-btn:hover {
    background: var(--rg-bg-hover);
    color: var(--rg-text-primary);
    border-color: var(--rg-border-active);
}
.rg-tb-btn.accent {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
}
.rg-tb-btn svg { width: 16px; height: 16px; }
.rg-notif-dot {
    position: absolute;
    top: 7px;
    inset-inline-end: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f43f5e;
    border: 2px solid var(--rg-bg-base);
}

/* Language Dropdown */
.rg-lang-dropdown {
    position: absolute;
    top: 44px;
    inset-inline-end: 0;
    background: var(--rg-bg-surface);
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius-lg);
    box-shadow: var(--rg-shadow-lg);
    z-index: 100;
    overflow: hidden;
    min-width: 150px;
    animation: rg-fadeIn 0.15s ease;
}
.rg-lang-opt {
    padding: 10px 16px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--rg-text-secondary);
    transition: all var(--rg-transition-fast);
}
.rg-lang-opt:hover {
    background: var(--rg-bg-hover);
    color: var(--rg-text-primary);
}
.rg-lang-opt.active {
    color: #10b981;
    background: rgba(16, 185, 129, 0.06);
}

/* ═══════════════════════════════════════════
   DASHBOARD BODY
   ═══════════════════════════════════════════ */
.rg-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px 32px 48px;
}

/* ═══════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════ */
.rg-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.rg-page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--rg-text-primary);
}
.rg-page-subtitle {
    font-size: 13px;
    color: var(--rg-text-muted);
    margin-top: 2px;
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.rg-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: var(--rg-radius-md);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--rg-transition-base);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.rg-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}
.rg-btn-primary svg { width: 15px; height: 15px; }

.rg-icon-btn {
    background: none;
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius-sm);
    padding: 5px;
    color: var(--rg-text-muted);
    transition: all var(--rg-transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.rg-icon-btn:hover {
    background: var(--rg-bg-hover);
    color: var(--rg-text-primary);
    border-color: var(--rg-border-active);
}
.rg-icon-btn svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════════
   METRIC CARDS
   ═══════════════════════════════════════════ */
.rg-metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.rg-metric-card {
    background: var(--rg-bg-surface);
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius-xl);
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--rg-transition-base);
    opacity: 0;
    animation: rg-fadeInUp 0.5s ease forwards;
}
.rg-metric-card:hover {
    border-color: var(--rg-border-active);
    transform: translateY(-1px);
    box-shadow: var(--rg-shadow-lg);
}
.rg-metric-glow {
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.07;
    pointer-events: none;
}
.rg-metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.rg-metric-label {
    font-size: 12.5px;
    color: var(--rg-text-secondary);
    font-weight: 500;
}
.rg-metric-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rg-metric-icon svg { width: 17px; height: 17px; }
.rg-metric-value {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 8px;
    color: var(--rg-text-primary);
}
.rg-metric-footer {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rg-metric-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
}
.rg-metric-change svg { width: 12px; height: 12px; }
.rg-metric-change.up { color: #34d399; background: rgba(16, 185, 129, 0.1); }
.rg-metric-change.down { color: #f87171; background: rgba(239, 68, 68, 0.1); }
.rg-metric-sub {
    font-size: 12px;
    color: var(--rg-text-muted);
}

/* ═══════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════ */
.rg-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.rg-card {
    background: var(--rg-bg-surface);
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius-xl);
    overflow: hidden;
    opacity: 0;
    animation: rg-fadeInUp 0.5s ease forwards;
}
.rg-card-header {
    padding: 20px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rg-card-title {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--rg-text-primary);
}
.rg-card-subtitle {
    font-size: 12px;
    color: var(--rg-text-muted);
    margin-top: 2px;
}
.rg-card-body {
    padding: 20px 14px 14px;
}

/* ═══════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════ */
.rg-table-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.rg-table-wrap {
    overflow-x: auto;
}
.rg-table-wrap::-webkit-scrollbar { height: 4px; }
.rg-table-wrap::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.15); border-radius: 3px; }

.rg-table { width: 100%; border-collapse: collapse; }
.rg-table th {
    text-align: start;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rg-text-muted);
    border-bottom: 1px solid var(--rg-border);
    white-space: nowrap;
}
.rg-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--rg-text-secondary);
    border-bottom: 1px solid var(--rg-border);
    white-space: nowrap;
    text-align: start;
}
.rg-table tr:last-child td { border-bottom: none; }
.rg-table tbody tr:hover td { background: var(--rg-bg-hover); }
.rg-table .td-primary { color: var(--rg-text-primary); font-weight: 500; }
.rg-table .td-mono { font-size: 12px; color: var(--rg-text-muted); font-variant-numeric: tabular-nums; }
.rg-table .td-amount { font-weight: 600; color: var(--rg-text-primary); font-variant-numeric: tabular-nums; }
.rg-table .td-muted { font-size: 12px; color: var(--rg-text-muted); }
.rg-table .td-ellipsis { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.rg-table-empty { text-align: center; padding: 32px; color: var(--rg-text-muted); }

/* ═══════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════ */
.rg-badge {
    padding: 3px 10px;
    border-radius: var(--rg-radius-sm);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
    text-transform: capitalize;
    letter-spacing: 0.02em;
    white-space: nowrap;
    display: inline-block;
}
.rg-badge-succeeded, .rg-badge-completed, .rg-badge-active, .rg-badge-approved, .rg-badge-won {
    background: rgba(16,185,129,0.12); color: #34d399; border-color: rgba(16,185,129,0.2);
}
.rg-badge-processing, .rg-badge-assigned, .rg-badge-new, .rg-badge-contacted {
    background: rgba(59,130,246,0.12); color: #60a5fa; border-color: rgba(59,130,246,0.2);
}
.rg-badge-failed, .rg-badge-declined, .rg-badge-lost {
    background: rgba(239,68,68,0.12); color: #f87171; border-color: rgba(239,68,68,0.2);
}
.rg-badge-in_progress, .rg-badge-ending, .rg-badge-paused {
    background: rgba(245,158,11,0.12); color: #d97706; border-color: rgba(245,158,11,0.2);
}
.rg-theme-dark .rg-badge-in_progress, .rg-theme-dark .rg-badge-ending, .rg-theme-dark .rg-badge-paused {
    color: #fbbf24;
}
.rg-badge-draft, .rg-badge-screening, .rg-badge-touring {
    background: rgba(139,92,246,0.12); color: #a78bfa; border-color: rgba(139,92,246,0.2);
}
.rg-badge-open, .rg-badge-ended, .rg-badge-former {
    background: rgba(148,163,184,0.12); color: #94a3b8; border-color: rgba(148,163,184,0.2);
}
.rg-badge-prospect, .rg-badge-applied {
    background: rgba(6,182,212,0.12); color: #22d3ee; border-color: rgba(6,182,212,0.2);
}

.rg-method-badge {
    padding: 3px 10px;
    border-radius: var(--rg-radius-sm);
    font-size: 11px;
    font-weight: 600;
    background: var(--rg-bg-elevated);
    color: var(--rg-text-secondary);
    border: 1px solid var(--rg-border);
}

/* Priority Dot */
.rg-priority {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--rg-text-secondary);
    font-weight: 500;
    text-transform: capitalize;
    letter-spacing: 0.02em;
}
.rg-priority-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rg-priority-emergency .rg-priority-dot {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239,68,68,0.5);
    animation: rg-pulse 2s infinite;
}
.rg-priority-high .rg-priority-dot { background: #f59e0b; }
.rg-priority-medium .rg-priority-dot { background: #3b82f6; }
.rg-priority-low .rg-priority-dot { background: #64748b; }

/* Score Badge */
.rg-score { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.rg-score-high { color: #34d399; }
.rg-score-mid { color: #fbbf24; }
.rg-score-low { color: #f87171; }

/* Star Rating */
.rg-star-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}
.rg-star-rating svg { width: 13px; height: 13px; color: #f59e0b; fill: #f59e0b; }
.rg-star-rating span { font-weight: 600; }

/* ═══════════════════════════════════════════
   FILTER TABS
   ═══════════════════════════════════════════ */
.rg-filter-tabs {
    display: flex;
    gap: 4px;
}
.rg-filter-tab {
    padding: 6px 14px;
    border-radius: var(--rg-radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--rg-text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    transition: all var(--rg-transition-fast);
    text-transform: capitalize;
}
.rg-filter-tab:hover {
    background: var(--rg-bg-hover);
    color: var(--rg-text-primary);
}
.rg-filter-tab.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

/* ═══════════════════════════════════════════
   BOTTOM GRID
   ═══════════════════════════════════════════ */
.rg-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* ═══════════════════════════════════════════
   OCCUPANCY BARS
   ═══════════════════════════════════════════ */
.rg-occ-track {
    width: 100%;
    height: 6px;
    background: var(--rg-bg-elevated);
    border-radius: 3px;
    overflow: hidden;
}
.rg-occ-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════
   LEASE ITEMS
   ═══════════════════════════════════════════ */
.rg-lease-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--rg-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background var(--rg-transition-fast);
}
.rg-lease-item:hover { background: var(--rg-bg-hover); }
.rg-lease-item:last-child { border-bottom: none; }
.rg-lease-tenant { font-size: 13px; font-weight: 500; color: var(--rg-text-primary); }
.rg-lease-unit { font-size: 12px; color: var(--rg-text-muted); }
.rg-lease-meta { text-align: end; display: flex; flex-direction: column; gap: 3px; }
.rg-lease-days {
    font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 5px; display: inline-block;
}
.rg-lease-days.urgent { color: #f87171; background: rgba(239,68,68,0.1); }
.rg-lease-days.warning { color: #fbbf24; background: rgba(245,158,11,0.1); }
.rg-lease-days.ok { color: var(--rg-text-secondary); background: var(--rg-bg-elevated); }
.rg-lease-rent { font-size: 12px; color: var(--rg-text-muted); }

/* ═══════════════════════════════════════════
   QUICK ACTIONS
   ═══════════════════════════════════════════ */
.rg-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 20px;
}
.rg-qa-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--rg-radius-lg);
    border: 1px solid var(--rg-border);
    background: var(--rg-bg-elevated);
    color: var(--rg-text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    transition: all var(--rg-transition-base);
    text-align: start;
}
.rg-qa-btn:hover {
    background: var(--rg-bg-hover);
    border-color: var(--rg-border-active);
    color: var(--rg-text-primary);
    transform: translateY(-1px);
}
.rg-qa-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rg-qa-icon svg { width: 14px; height: 14px; }

/* ═══════════════════════════════════════════
   ACTIVITY FEED
   ═══════════════════════════════════════════ */
.rg-activity-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--rg-border);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: background var(--rg-transition-fast);
}
.rg-activity-item:hover { background: var(--rg-bg-hover); }
.rg-activity-item:last-child { border-bottom: none; }
.rg-activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.rg-activity-text { font-size: 13px; color: var(--rg-text-secondary); line-height: 1.5; }
.rg-activity-text strong { color: var(--rg-text-primary); font-weight: 500; }
.rg-activity-time { font-size: 11px; color: var(--rg-text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════
   MESSAGES
   ═══════════════════════════════════════════ */
.rg-message-row {
    padding: 16px 24px;
    border-bottom: 1px solid var(--rg-border);
    display: flex;
    gap: 14px;
    align-items: flex-start;
    cursor: pointer;
    transition: all var(--rg-transition-fast);
}
.rg-message-row:hover { background: var(--rg-bg-hover); }
.rg-message-row.selected {
    background: rgba(16, 185, 129, 0.04);
    border-inline-start: 3px solid #10b981;
}
.rg-msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--rg-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--rg-text-primary);
    flex-shrink: 0;
}
.rg-unread-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #3b82f6;
    flex-shrink: 0;
    margin-top: 8px;
}

/* ═══════════════════════════════════════════
   AI TOOL CARDS
   ═══════════════════════════════════════════ */
.rg-ai-tool-card {
    background: var(--rg-bg-elevated);
    border: 1px solid var(--rg-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--rg-transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.rg-ai-tool-card:hover {
    border-color: var(--rg-border-active);
    transform: translateY(-2px);
    box-shadow: var(--rg-shadow-lg);
}

/* ═══════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════ */
.rg-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.rg-setting-row { display: flex; flex-direction: column; gap: 6px; }
.rg-setting-label {
    font-size: 12px; font-weight: 600; color: var(--rg-text-secondary);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.rg-setting-input {
    padding: 10px 14px;
    border-radius: var(--rg-radius-md);
    border: 1px solid var(--rg-border);
    background: var(--rg-bg-elevated);
    color: var(--rg-text-primary);
    font-size: 13px;
    outline: none;
    transition: all var(--rg-transition-base);
}
.rg-setting-input:focus {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: var(--rg-focus-ring);
}
.rg-toggle-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--rg-radius-sm);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--rg-transition-fast);
    border: 1px solid transparent;
}
.rg-toggle-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}
.rg-toggle-badge svg { width: 12px; height: 12px; }

/* ═══════════════════════════════════════════
   BILLING PLANS
   ═══════════════════════════════════════════ */
.rg-plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 20px;
}
.rg-plan-card {
    background: var(--rg-bg-elevated);
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius-xl);
    padding: 24px;
    position: relative;
    transition: all var(--rg-transition-base);
}
.rg-plan-card:hover {
    border-color: var(--rg-border-active);
    transform: translateY(-2px);
    box-shadow: var(--rg-shadow-lg);
}
.rg-plan-card.current {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.1);
}
.rg-plan-badge {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    font-size: 10px;
    font-weight: 600;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid rgba(16, 185, 129, 0.15);
}
.rg-plan-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.rg-plan-price { font-size: 28px; font-weight: 700; margin-bottom: 16px; }
.rg-plan-price span { font-size: 13px; font-weight: 400; color: var(--rg-text-muted); }
.rg-plan-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--rg-text-secondary);
    margin-bottom: 8px;
}
.rg-plan-feature svg { width: 13px; height: 13px; color: #10b981; flex-shrink: 0; }
.rg-plan-btn {
    width: 100%;
    margin-top: 20px;
    padding: 10px;
    border-radius: var(--rg-radius-md);
    border: 1px solid var(--rg-border);
    background: transparent;
    color: var(--rg-text-secondary);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--rg-transition-fast);
}
.rg-plan-btn:hover { background: var(--rg-bg-hover); color: var(--rg-text-primary); }
.rg-plan-btn.current {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
    cursor: default;
}

/* ═══════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════ */
.rg-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--rg-bg-overlay);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 20px 20px;
    overflow-y: auto;
    animation: rg-modalFadeIn 0.2s ease;
}
.rg-modal-overlay.hidden { display: none; }
.rg-modal-container {
    background: var(--rg-bg-surface);
    border: 1px solid var(--rg-border-active);
    border-radius: var(--rg-radius-2xl);
    width: 100%;
    max-width: 560px;
    box-shadow: var(--rg-shadow-xl);
    animation: rg-modalSlideIn 0.25s ease;
}
.rg-modal-container.wide { max-width: 620px; }
.rg-modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.rg-modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rg-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--rg-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rg-modal-icon svg { width: 18px; height: 18px; }
.rg-modal-title { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.rg-modal-subtitle { font-size: 12.5px; color: var(--rg-text-muted); margin-top: 2px; }
.rg-modal-close {
    width: 32px; height: 32px; border-radius: var(--rg-radius-md);
    border: 1px solid var(--rg-border); background: transparent;
    color: var(--rg-text-muted); display: flex; align-items: center;
    justify-content: center; transition: all var(--rg-transition-fast); flex-shrink: 0;
}
.rg-modal-close:hover { background: var(--rg-bg-hover); color: var(--rg-text-primary); }
.rg-modal-close svg { width: 18px; height: 18px; }
.rg-modal-body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ═══════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════ */
.rg-form-field { display: flex; flex-direction: column; gap: 6px; }
.rg-form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--rg-text-secondary);
    letter-spacing: 0.01em;
}
.rg-form-label .required { color: #f43f5e; margin-inline-start: 2px; }
.rg-form-input {
    padding: 10px 14px;
    border-radius: 9px;
    border: 1px solid var(--rg-border);
    background: var(--rg-bg-elevated);
    color: var(--rg-text-primary);
    font-size: 13.5px;
    outline: none;
    transition: all var(--rg-transition-base);
    width: 100%;
}
.rg-form-input:focus {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: var(--rg-focus-ring);
}
.rg-form-input::placeholder { color: var(--rg-text-muted); }
select.rg-form-input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-inline-end: 36px;
    cursor: pointer;
}
[dir="rtl"] select.rg-form-input {
    background-position: left 12px center;
}
select.rg-form-input option {
    background: var(--rg-bg-surface);
    color: var(--rg-text-primary);
}
textarea.rg-form-input {
    resize: vertical;
    min-height: 60px;
    line-height: 1.5;
}
.rg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.rg-form-divider {
    height: 1px;
    background: var(--rg-border);
    margin: 4px 0;
}
.rg-form-section-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--rg-text-primary);
    letter-spacing: -0.01em;
    margin-bottom: -4px;
}
.rg-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--rg-border);
    margin-top: 4px;
}
.rg-form-btn {
    padding: 10px 20px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    transition: all var(--rg-transition-base);
    display: flex;
    align-items: center;
    gap: 7px;
}
.rg-form-btn svg { width: 15px; height: 15px; }
.rg-form-btn-cancel {
    background: transparent;
    border: 1px solid var(--rg-border);
    color: var(--rg-text-secondary);
}
.rg-form-btn-cancel:hover {
    background: var(--rg-bg-hover);
    color: var(--rg-text-primary);
    border-color: var(--rg-border-active);
}
.rg-form-btn-submit {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.rg-form-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

/* Amenity checkboxes */
.rg-amenity-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.rg-amenity-check {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 7px;
    border: 1px solid var(--rg-border);
    background: var(--rg-bg-elevated);
    cursor: pointer;
    transition: all var(--rg-transition-fast);
    font-size: 12.5px;
    color: var(--rg-text-secondary);
    user-select: none;
}
.rg-amenity-check:hover {
    background: var(--rg-bg-hover);
    border-color: var(--rg-border-active);
    color: var(--rg-text-primary);
}
.rg-amenity-check:has(input:checked) {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    color: #10b981;
}
.rg-amenity-check input[type="checkbox"] {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    accent-color: #10b981;
    cursor: pointer;
}

/* Upload zone */
.rg-upload-zone {
    border: 2px dashed var(--rg-border);
    border-radius: var(--rg-radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--rg-transition-base);
    font-size: 12.5px;
    color: var(--rg-text-muted);
}
.rg-upload-zone:hover {
    border-color: var(--rg-border-active);
    background: var(--rg-bg-hover);
}
.rg-upload-zone svg { width: 20px; height: 20px; }

/* ═══════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════ */
.rg-toast-container {
    position: fixed;
    top: 24px;
    inset-inline-end: 24px;
    z-index: 300;
    animation: rg-toastSlide 0.3s ease;
}
.rg-toast-container.hidden { display: none; }
.rg-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--rg-bg-surface);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 12px;
    box-shadow: var(--rg-shadow-lg);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--rg-text-primary);
}
.rg-toast svg:first-child { width: 18px; height: 18px; color: #10b981; flex-shrink: 0; }
.rg-toast-close {
    background: none;
    border: none;
    color: var(--rg-text-muted);
    padding: 2px;
    display: flex;
    align-items: center;
    transition: color var(--rg-transition-fast);
    margin-inline-start: 8px;
}
.rg-toast-close:hover { color: var(--rg-text-primary); }
.rg-toast-close svg { width: 14px; height: 14px; }

/* ═══════════════════════════════════════════
   CHART TOOLTIP
   ═══════════════════════════════════════════ */
.rg-chart-tooltip {
    background: var(--rg-bg-surface);
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius-lg);
    padding: 12px 16px;
    box-shadow: var(--rg-shadow-lg);
}
.rg-chart-tooltip-label { color: var(--rg-text-muted); font-size: 12px; margin-bottom: 6px; }
.rg-chart-tooltip-val { font-size: 13px; font-weight: 500; color: var(--rg-text-secondary); }
.rg-chart-tooltip-val strong { color: var(--rg-text-primary); font-weight: 600; }

/* ═══════════════════════════════════════════
   EXPORT ACTIONS
   ═══════════════════════════════════════════ */
.rg-export-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 24px;
}

/* ═══════════════════════════════════════════
   MOBILE MENU TOGGLE & SEARCH (hidden on desktop)
   ═══════════════════════════════════════════ */
.rg-menu-toggle { display: none; }
.rg-mobile-search { display: none; }

/* ═══════════════════════════════════════════
   QUICK ACTIONS DROPDOWN
   ═══════════════════════════════════════════ */
.rg-quick-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    background: var(--rg-bg-surface);
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius-lg);
    box-shadow: var(--rg-shadow-xl);
    min-width: 200px;
    padding: 6px;
    z-index: 100;
}
.rg-quick-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--rg-radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--rg-text-secondary);
    transition: all var(--rg-transition-fast);
}
.rg-quick-item:hover {
    background: var(--rg-bg-hover);
    color: var(--rg-text-primary);
}
.rg-quick-item svg { flex-shrink: 0; opacity: 0.7; }
.rg-quick-item:hover svg { opacity: 1; }

/* ═══════════════════════════════════════════
   SIDEBAR OVERLAY (mobile)
   ═══════════════════════════════════════════ */
.rg-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 49;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 1400px) {
    .rg-metrics-row { grid-template-columns: repeat(2, 1fr); }
    .rg-charts-grid { grid-template-columns: 1fr; }
    .rg-table-grid { grid-template-columns: 1fr; }
    .rg-bottom-grid { grid-template-columns: 1fr 1fr; }
    .rg-settings-grid { grid-template-columns: 1fr; }
    .rg-plans-grid { grid-template-columns: repeat(2, 1fr); }
    .rg-export-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    /* Show hamburger + mobile search */
    .rg-menu-toggle { display: flex; }
    .rg-mobile-search { display: flex; }

    /* Hide topbar title & subtitle */
    .rg-topbar-title,
    .rg-topbar-sub { display: none; }

    /* Sidebar: hidden by default, slides in when .mobile-open */
    .rg-sidebar {
        display: flex;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 60;
    }
    [dir="rtl"] .rg-sidebar {
        transform: translateX(100%);
    }
    .rg-sidebar.mobile-open {
        transform: translateX(0);
    }
    .rg-sidebar-overlay { display: none; }
    .rg-sidebar.mobile-open ~ .rg-sidebar-overlay { display: block; }

    /* Search bar: hidden by default, expands as topbar overlay */
    .rg-search-bar { display: none; }
    .rg-search-bar.mobile-active {
        display: flex;
        position: absolute;
        inset-inline-start: 0;
        top: 0;
        width: 100%;
        height: 100%;
        z-index: 45;
        border-radius: 0;
        border: none;
        background: var(--rg-bg-base);
        padding: 0 16px;
        box-sizing: border-box;
    }
    .rg-search-bar.mobile-active input {
        font-size: 15px;
    }
    .rg-search-bar.mobile-active .rg-search-key { display: none; }

    .rg-main { margin-inline-start: 0 !important; }
    .rg-topbar { position: relative; }
    .rg-metrics-row { grid-template-columns: 1fr; }
    .rg-bottom-grid { grid-template-columns: 1fr; }
    .rg-body { padding: 20px 16px; }
    .rg-topbar { padding: 14px 16px; }
    .rg-plans-grid { grid-template-columns: 1fr; }
    .rg-modal-overlay { padding: 20px 12px; }
    .rg-modal-container { max-width: 100% !important; }
    .rg-form-row { grid-template-columns: 1fr; }
    .rg-ai-tool-card { padding: 14px; }
}

/* ═══════════════════════════════════════════════════════════════
   TENANT PORTAL — Component Extensions
   Reuses the entire admin design system plus these additions
   ═══════════════════════════════════════════════════════════════ */

/* ── Rent Due Hero Card ── */
.rg-rent-hero {
    background: var(--rg-bg-surface);
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius-xl);
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    animation: rg-fadeInUp 0.5s ease both;
}
.rg-rent-hero-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rg-rent-hero-greeting {
    font-size: 13px;
    color: var(--rg-text-muted);
    font-weight: 500;
}
.rg-rent-hero-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--rg-text-primary);
    line-height: 1.2;
}
.rg-rent-hero-due {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.rg-rent-hero-due-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rg-rent-hero-due-icon.on-time {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}
.rg-rent-hero-due-icon.due-soon {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}
.rg-rent-hero-due-icon.overdue {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}
.rg-rent-hero-due-text {
    font-size: 13px;
    color: var(--rg-text-secondary);
    font-weight: 500;
}
.rg-rent-hero-right {
    text-align: end;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}
[dir="rtl"] .rg-rent-hero-right {
    text-align: start;
    align-items: flex-start;
}
.rg-rent-hero-amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--rg-text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.rg-rent-hero-label {
    font-size: 12px;
    color: var(--rg-text-muted);
    font-weight: 500;
}

/* ── Payment CTA Button ── */
.rg-btn-pay {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: var(--rg-radius-md);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--rg-transition-base);
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.25);
}
.rg-btn-pay:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

/* ── Detail Card (key-value pairs) ── */
.rg-detail-card {
    background: var(--rg-bg-surface);
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius-xl);
    overflow: hidden;
    animation: rg-fadeInUp 0.5s ease both;
}
.rg-detail-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--rg-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rg-detail-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--rg-text-primary);
}
.rg-detail-card-subtitle {
    font-size: 12px;
    color: var(--rg-text-muted);
    margin-top: 2px;
}
.rg-detail-rows {
    padding: 8px 0;
}
.rg-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    transition: background var(--rg-transition-fast);
}
.rg-detail-row:hover {
    background: var(--rg-bg-hover);
}
.rg-detail-row-label {
    font-size: 13px;
    color: var(--rg-text-muted);
    font-weight: 500;
}
.rg-detail-row-value {
    font-size: 13px;
    color: var(--rg-text-primary);
    font-weight: 600;
    text-align: end;
}
[dir="rtl"] .rg-detail-row-value {
    text-align: start;
}

/* ── Document List Item ── */
.rg-doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--rg-border);
    transition: background var(--rg-transition-fast);
}
.rg-doc-item:last-child { border-bottom: none; }
.rg-doc-item:hover { background: var(--rg-bg-hover); }
.rg-doc-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rg-doc-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--rg-radius-md);
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rg-doc-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--rg-text-primary);
}
.rg-doc-meta {
    font-size: 11px;
    color: var(--rg-text-muted);
    margin-top: 2px;
}
.rg-doc-actions {
    display: flex;
    gap: 6px;
}
.rg-doc-btn {
    padding: 5px 12px;
    border-radius: var(--rg-radius-sm);
    border: 1px solid var(--rg-border);
    background: var(--rg-bg-elevated);
    color: var(--rg-text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--rg-transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.rg-doc-btn:hover {
    background: var(--rg-bg-hover);
    border-color: var(--rg-border-active);
    color: var(--rg-text-primary);
}

/* ── Amenity Grid (Chips) ── */
.rg-amenity-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px 24px;
}
.rg-amenity-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid var(--rg-border);
    background: var(--rg-bg-elevated);
    color: var(--rg-text-secondary);
    font-size: 12px;
    font-weight: 500;
    transition: all var(--rg-transition-fast);
}
.rg-amenity-chip svg { width: 13px; height: 13px; color: #10b981; }

/* ── Emergency Contact Card ── */
.rg-contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--rg-border);
    transition: background var(--rg-transition-fast);
}
.rg-contact-item:last-child { border-bottom: none; }
.rg-contact-item:hover { background: var(--rg-bg-hover); }
.rg-contact-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--rg-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rg-contact-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--rg-text-primary);
}
.rg-contact-detail {
    font-size: 12px;
    color: var(--rg-text-muted);
    margin-top: 2px;
}

/* ── Profile Form Sections ── */
.rg-profile-section {
    background: var(--rg-bg-surface);
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius-xl);
    overflow: hidden;
    animation: rg-fadeInUp 0.5s ease both;
}
.rg-profile-section + .rg-profile-section {
    margin-top: 16px;
}
.rg-profile-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--rg-border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.rg-profile-header-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rg-profile-header-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--rg-text-primary);
}
.rg-profile-header-sub {
    font-size: 12px;
    color: var(--rg-text-muted);
    margin-top: 1px;
}
.rg-profile-body {
    padding: 24px;
}
.rg-profile-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.rg-profile-form-grid .full-width {
    grid-column: 1 / -1;
}
.rg-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--rg-radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--rg-transition-base);
}
.rg-profile-btn-primary {
    background: var(--rg-accent-emerald);
    color: #fff;
}
.rg-profile-btn-primary:hover {
    background: var(--rg-accent-emerald-hover);
}
.rg-profile-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.rg-profile-btn-danger:hover {
    background: rgba(239, 68, 68, 0.18);
}
.rg-profile-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
[dir="rtl"] .rg-profile-actions {
    justify-content: flex-start;
}

/* ── Toggle Switch ── */
.rg-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--rg-border);
}
.rg-toggle-row:last-child { border-bottom: none; }
.rg-toggle-label {
    font-size: 13px;
    color: var(--rg-text-secondary);
    font-weight: 500;
}
.rg-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: var(--rg-bg-elevated);
    border: 1px solid var(--rg-border-active);
    cursor: pointer;
    transition: all var(--rg-transition-base);
    flex-shrink: 0;
}
.rg-toggle.active {
    background: #10b981;
    border-color: #10b981;
}
.rg-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform var(--rg-transition-base);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.rg-toggle.active::after {
    transform: translateX(18px);
}
[dir="rtl"] .rg-toggle.active::after {
    transform: translateX(-18px);
}

/* ── Message Thread View ── */
.rg-thread-list {
    max-height: 400px;
    overflow-y: auto;
}
.rg-thread-item {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--rg-border);
    transition: background var(--rg-transition-fast);
    cursor: pointer;
}
.rg-thread-item:hover { background: var(--rg-bg-hover); }
.rg-thread-item.selected { background: var(--rg-bg-hover); border-inline-start: 3px solid #10b981; }
.rg-thread-item:last-child { border-bottom: none; }
.rg-thread-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.rg-thread-content {
    flex: 1;
    min-width: 0;
}
.rg-thread-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}
.rg-thread-from {
    font-size: 13px;
    font-weight: 600;
    color: var(--rg-text-primary);
}
.rg-thread-time {
    font-size: 11px;
    color: var(--rg-text-muted);
    flex-shrink: 0;
}
.rg-thread-subject {
    font-size: 12.5px;
    color: var(--rg-text-secondary);
    font-weight: 500;
}
.rg-thread-preview {
    font-size: 12px;
    color: var(--rg-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.rg-thread-item.unread .rg-thread-from { color: var(--rg-text-primary); }
.rg-thread-item.unread .rg-thread-subject { color: var(--rg-text-primary); font-weight: 600; }

/* ── Compose Bar ── */
.rg-compose-bar {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--rg-border);
    align-items: flex-end;
}
.rg-compose-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--rg-radius-md);
    border: 1px solid var(--rg-border);
    background: var(--rg-bg-elevated);
    color: var(--rg-text-primary);
    font-size: 13px;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    transition: border-color var(--rg-transition-fast);
}
.rg-compose-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: var(--rg-focus-ring);
}
.rg-compose-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--rg-radius-md);
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--rg-transition-base);
}
.rg-compose-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.3);
}

/* ── Status Timeline ── */
.rg-timeline {
    padding: 16px 24px;
}
.rg-timeline-step {
    display: flex;
    gap: 14px;
    padding-bottom: 20px;
    position: relative;
}
.rg-timeline-step:last-child { padding-bottom: 0; }
.rg-timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    inset-inline-start: 13px;
    top: 30px;
    bottom: 0;
    width: 2px;
    background: var(--rg-border);
}
.rg-timeline-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.rg-timeline-dot.completed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}
.rg-timeline-dot.current {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    animation: rg-pulse 2s infinite;
}
.rg-timeline-dot.pending {
    background: var(--rg-bg-elevated);
    color: var(--rg-text-muted);
}
.rg-timeline-step-content { flex: 1; }
.rg-timeline-step-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--rg-text-primary);
}
.rg-timeline-step-desc {
    font-size: 12px;
    color: var(--rg-text-muted);
    margin-top: 2px;
}

/* ── Tenant 2-Column Layout ── */
.rg-tenant-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.rg-tenant-grid .span-full {
    grid-column: 1 / -1;
}

/* ═══════════════════════════════════════════
   VENDOR PORTAL COMPONENTS
   ═══════════════════════════════════════════ */
.rg-vendor-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
    border: none; cursor: pointer; transition: all 0.15s;
    background: rgba(245, 158, 11, 0.1); color: #f59e0b;
}
.rg-vendor-btn:hover { background: rgba(245, 158, 11, 0.2); }
.rg-vendor-btn.success { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.rg-vendor-btn.success:hover { background: rgba(16, 185, 129, 0.2); }
.rg-vendor-btn.outline { background: transparent; border: 1px solid var(--rg-border); color: var(--rg-text-secondary); }
.rg-vendor-btn.outline:hover { border-color: var(--rg-border-active); color: var(--rg-text-primary); }
.rg-vendor-tab { font-family: inherit; }
.rg-vendor-tab:hover { border-color: rgba(245, 158, 11, 0.3) !important; }

/* ═══════════════════════════════════════════
   SITE ADMIN PORTAL COMPONENTS
   ═══════════════════════════════════════════ */
.rg-sa-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
    border: none; cursor: pointer; transition: all 0.15s; font-family: inherit;
    background: rgba(139, 92, 246, 0.1); color: #8b5cf6;
}
.rg-sa-btn:hover { background: rgba(139, 92, 246, 0.2); }
.rg-sa-btn.primary { background: #8b5cf6; color: #fff; }
.rg-sa-btn.primary:hover { background: #7c3aed; }
.rg-sa-btn.outline { background: transparent; border: 1px solid var(--rg-border); color: var(--rg-text-secondary); }
.rg-sa-btn.outline:hover { border-color: rgba(139, 92, 246, 0.3); color: #8b5cf6; }
.rg-sa-field-input { width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--rg-border); background: var(--rg-bg-elevated); color: var(--rg-text-primary); font-size: 13px; font-family: inherit; transition: border-color .2s; box-sizing: border-box; }
.rg-sa-field-input:focus { outline: none; border-color: var(--rg-accent, #10b981); }
.rg-sa-field-input::placeholder { color: var(--rg-text-muted); }

/* ── Empty State ── */
.rg-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}
.rg-empty-state-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: var(--rg-bg-elevated);
    color: var(--rg-text-muted);
}
.rg-empty-state-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--rg-text-primary);
    margin-bottom: 4px;
}
.rg-empty-state-desc {
    font-size: 13px;
    color: var(--rg-text-muted);
    max-width: 300px;
}

/* ── Tenant Responsive ── */
@media (max-width: 1400px) {
    .rg-tenant-grid { grid-template-columns: 1fr; }
    .rg-profile-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .rg-rent-hero { flex-direction: column; text-align: center; align-items: stretch; }
    .rg-rent-hero-right { align-items: center; text-align: center; }
    [dir="rtl"] .rg-rent-hero-right { align-items: center; text-align: center; }
    .rg-rent-hero-due { justify-content: center; }
    .rg-compose-bar { flex-direction: column; }
    .rg-compose-btn { width: 100%; height: 42px; }
}

/* ═══════════════════════════════════════════════════════════════
   BUILDINGS & UNITS CRUD — Page-specific styles
   ═══════════════════════════════════════════════════════════════ */

/* Loading */
.rg-b-loading { display:flex; align-items:center; justify-content:center; gap:12px; padding:80px 20px; color:var(--rg-text-muted); font-size:14px; }
.rg-b-spinner { width:20px; height:20px; border:2px solid var(--rg-border); border-top-color:#10b981; border-radius:50%; animation:rg-spin 0.6s linear infinite; }
.rg-b-spinner-sm { display:inline-block; width:14px; height:14px; border:2px solid rgba(255,255,255,0.3); border-top-color:#fff; border-radius:50%; animation:rg-spin 0.6s linear infinite; vertical-align:middle; }
@keyframes rg-spin { to { transform:rotate(360deg); } }

/* Empty state */
.rg-b-empty { text-align:center; padding:60px 20px; }
.rg-b-empty-icon { width:64px; height:64px; border-radius:16px; background:var(--rg-bg-elevated); display:flex; align-items:center; justify-content:center; margin:0 auto 16px; color:var(--rg-text-muted); }
.rg-b-empty-title { font-size:16px; font-weight:600; color:var(--rg-text-primary); margin-bottom:4px; }
.rg-b-empty-sub { font-size:13px; color:var(--rg-text-muted); margin-bottom:20px; }

/* Back link */
.rg-b-back { display:inline-flex; align-items:center; gap:6px; color:var(--rg-text-muted); font-size:13px; font-weight:500; text-decoration:none; margin-bottom:16px; transition:color 0.15s; }
.rg-b-back:hover { color:#10b981; }

/* Buttons */
.rg-b-btn { display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border-radius:8px; font-size:13px; font-weight:600; font-family:inherit; border:none; cursor:pointer; transition:all 0.15s; text-decoration:none; white-space:nowrap; }
.rg-b-btn.primary { background:#10b981; color:#fff; }
.rg-b-btn.primary:hover { background:#059669; }
.rg-b-btn.primary:disabled { opacity:0.6; cursor:not-allowed; }
.rg-b-btn.outline { background:transparent; color:var(--rg-text-secondary); border:1px solid var(--rg-border); }
.rg-b-btn.outline:hover { border-color:var(--rg-text-muted); color:var(--rg-text-primary); }
.rg-b-btn.danger-outline { background:transparent; color:#ef4444; border:1px solid rgba(239,68,68,0.3); }
.rg-b-btn.danger-outline:hover { background:rgba(239,68,68,0.08); }

.rg-b-icon-btn { width:30px; height:30px; border-radius:6px; border:none; background:transparent; cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--rg-text-muted); transition:all 0.15s; }
.rg-b-icon-btn:hover { background:var(--rg-bg-hover); color:var(--rg-text-primary); }
.rg-b-icon-btn.danger:hover { background:rgba(239,68,68,0.08); color:#ef4444; }

/* Badge */
.rg-b-badge { display:inline-block; padding:2px 8px; border-radius:5px; font-size:11px; font-weight:600; text-transform:capitalize; }
.rg-b-tag { display:inline-block; padding:2px 8px; border-radius:5px; font-size:11px; font-weight:500; background:var(--rg-bg-elevated); color:var(--rg-text-secondary); }

/* Page header */
.rg-b-page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; gap:12px; flex-wrap:wrap; }
.rg-b-page-title { font-size:22px; font-weight:700; color:var(--rg-text-primary); letter-spacing:-0.02em; }
.rg-b-page-sub { font-size:13px; color:var(--rg-text-muted); margin-top:2px; }

/* Metrics row */
.rg-b-metrics { display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; margin-bottom:20px; }
.rg-b-metric { display:flex; align-items:center; gap:12px; padding:16px; background:var(--rg-bg-card); border:1px solid var(--rg-border); border-radius:12px; }
.rg-b-metric-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.rg-b-metric-val { font-size:20px; font-weight:700; color:var(--rg-text-primary); line-height:1.2; }
.rg-b-metric-label { font-size:12px; color:var(--rg-text-muted); }

/* Card container */
.rg-b-card { background:var(--rg-bg-card); border:1px solid var(--rg-border); border-radius:12px; overflow:hidden; }

/* Table */
.rg-b-table { width:100%; border-collapse:collapse; font-size:13px; }
.rg-b-table thead th { padding:10px 14px; text-align:start; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:0.04em; color:var(--rg-text-muted); background:var(--rg-bg-elevated); border-bottom:1px solid var(--rg-border); white-space:nowrap; }
.rg-b-table tbody td { padding:12px 14px; border-bottom:1px solid var(--rg-border); color:var(--rg-text-secondary); vertical-align:middle; }
.rg-b-table tbody tr:last-child td { border-bottom:none; }
.rg-b-row { cursor:pointer; transition:background 0.1s; }
.rg-b-row:hover { background:var(--rg-bg-hover); }
.rg-b-td-primary { font-weight:600; color:var(--rg-text-primary) !important; }
.rg-b-td-secondary { font-size:12px; }
.rg-b-td-amount { font-weight:600; font-variant-numeric:tabular-nums; }
.rg-b-row-actions { display:flex; gap:4px; justify-content:flex-end; }

/* Building name cell */
.rg-b-building-name { display:flex; align-items:center; gap:10px; }
.rg-b-building-thumb { width:36px; height:36px; border-radius:8px; background:var(--rg-bg-elevated); display:flex; align-items:center; justify-content:center; overflow:hidden; flex-shrink:0; color:var(--rg-text-muted); }
.rg-b-building-thumb img { width:100%; height:100%; object-fit:cover; }
.rg-b-building-title { font-weight:600; color:var(--rg-text-primary); }
.rg-b-building-meta { font-size:11px; color:var(--rg-text-muted); }

/* ── Detail Page ── */
.rg-b-detail-header { display:flex; gap:20px; margin-bottom:24px; background:var(--rg-bg-card); border:1px solid var(--rg-border); border-radius:14px; overflow:hidden; }
.rg-b-detail-cover { width:240px; min-height:200px; background:var(--rg-bg-elevated); flex-shrink:0; display:flex; align-items:center; justify-content:center; }
.rg-b-detail-cover img { width:100%; height:100%; object-fit:cover; }
.rg-b-detail-cover-empty { color:var(--rg-text-muted); opacity:0.4; }
.rg-b-detail-info { flex:1; padding:20px; min-width:0; }
.rg-b-detail-top { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:10px; }
.rg-b-detail-title { font-size:20px; font-weight:700; color:var(--rg-text-primary); margin:0; }
.rg-b-detail-address { font-size:13px; color:var(--rg-text-muted); display:flex; align-items:center; gap:4px; margin-top:4px; }
.rg-b-detail-actions { display:flex; gap:8px; flex-shrink:0; }
.rg-b-detail-tags { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.rg-b-detail-desc { font-size:13px; color:var(--rg-text-secondary); line-height:1.6; margin-bottom:10px; }
.rg-b-detail-amenities { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:10px; }
.rg-b-amenity-tag { padding:3px 8px; border-radius:5px; font-size:11px; background:rgba(16,185,129,0.08); color:#10b981; font-weight:500; }
.rg-b-detail-contact { display:flex; gap:16px; font-size:12px; color:var(--rg-text-muted); }
.rg-b-detail-contact span { display:flex; align-items:center; gap:4px; }

/* Section header (units list) */
.rg-b-section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; gap:12px; }
.rg-b-section-title { font-size:16px; font-weight:700; color:var(--rg-text-primary); display:flex; align-items:center; gap:8px; }
.rg-b-section-sub { font-size:12px; color:var(--rg-text-muted); margin-top:2px; }
.rg-b-count { background:var(--rg-bg-elevated); color:var(--rg-text-secondary); font-size:12px; font-weight:600; padding:1px 7px; border-radius:5px; }

/* ── Form ── */
.rg-b-form-header { display:flex; align-items:center; gap:14px; margin-bottom:24px; }
.rg-b-form-header-icon { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.rg-b-form-title { font-size:18px; font-weight:700; color:var(--rg-text-primary); margin:0; }
.rg-b-form-sub { font-size:13px; color:var(--rg-text-muted); margin-top:2px; }

.rg-b-form { max-width:860px; }
.rg-b-form-section { background:var(--rg-bg-card); border:1px solid var(--rg-border); border-radius:12px; padding:20px; margin-bottom:16px; }
.rg-b-form-section-label { font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:0.05em; color:var(--rg-text-muted); margin-bottom:14px; display:flex; align-items:center; gap:6px; }

.rg-b-form-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.rg-b-form-grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; margin-bottom:12px; }
.rg-b-form-grid-4 { display:grid; grid-template-columns:1fr 1fr 1fr 1fr; gap:12px; margin-bottom:12px; }

.rg-b-field { margin-bottom:12px; }
.rg-b-field label { display:block; font-size:12px; font-weight:600; color:var(--rg-text-secondary); margin-bottom:4px; }
.rg-b-field label .req { color:#ef4444; }
.rg-b-field input,
.rg-b-field select,
.rg-b-field textarea {
    width:100%; padding:8px 12px; border:1px solid var(--rg-border); border-radius:8px;
    background:var(--rg-bg-elevated); color:var(--rg-text-primary); font-size:13px;
    font-family:inherit; transition:border-color 0.15s; outline:none; box-sizing:border-box;
}
.rg-b-field input:focus,
.rg-b-field select:focus,
.rg-b-field textarea:focus { border-color:#10b981; box-shadow:0 0 0 2px rgba(16,185,129,0.15); }
.rg-b-field textarea { resize:vertical; }
.rg-b-field select { appearance:auto; }

/* Toggle label */
.rg-b-toggle-label { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--rg-text-secondary); cursor:pointer; font-weight:500; }
.rg-b-toggle-label input[type="checkbox"] { width:16px; height:16px; accent-color:#10b981; }

/* Map */
.rg-b-map { width:100%; height:280px; border-radius:10px; border:1px solid var(--rg-border); overflow:hidden; margin-top:8px; }
.rg-b-map-search { display:flex; gap:8px; }
.rg-b-map-search input { flex:1; padding:8px 12px; border:1px solid var(--rg-border); border-radius:8px; background:var(--rg-bg-elevated); color:var(--rg-text-primary); font-size:13px; font-family:inherit; outline:none; }
.rg-b-map-search input:focus { border-color:#10b981; }

/* Address display (resolved from map pin) */
.rg-b-address-display { display:flex; align-items:center; gap:10px; padding:12px 14px; background:rgba(16,185,129,0.06); border:1px solid rgba(16,185,129,0.15); border-radius:9px; margin-top:12px; }
.rg-b-address-display.empty { background:var(--rg-bg-elevated); border-color:var(--rg-border); }
.rg-b-address-display.empty .rg-b-address-icon { color:var(--rg-text-muted); }
.rg-b-address-display.loading .rg-b-address-icon { animation:rg-spin 0.8s linear infinite; }
.rg-b-address-icon { color:#10b981; flex-shrink:0; }
.rg-b-address-text { font-size:13px; color:var(--rg-text-primary); font-weight:500; }
.rg-b-address-display.empty .rg-b-address-text { color:var(--rg-text-muted); font-weight:400; }

/* Amenity grid */
.rg-b-amenity-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:6px; }
.rg-b-amenity-item { display:flex; align-items:center; gap:6px; padding:6px 10px; border-radius:7px; font-size:12px; color:var(--rg-text-secondary); cursor:pointer; transition:background 0.1s; border:1px solid transparent; }
.rg-b-amenity-item:hover { background:var(--rg-bg-hover); }
.rg-b-amenity-item input { accent-color:#10b981; width:14px; height:14px; }

/* Form actions */
.rg-b-form-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; padding-top:8px; padding-bottom:20px; }

/* ── Secondary/Danger buttons ── */
.rg-b-btn.secondary { background:var(--rg-bg-elevated); color:var(--rg-text-secondary); border:1px solid var(--rg-border); }
.rg-b-btn.secondary:hover { border-color:var(--rg-text-muted); color:var(--rg-text-primary); background:var(--rg-bg-hover); }
.rg-b-btn.danger { background:rgba(239,68,68,0.08); color:#ef4444; border:1px solid rgba(239,68,68,0.15); }
.rg-b-btn.danger:hover { background:rgba(239,68,68,0.15); }
.rg-b-btn.small { padding:5px 10px; font-size:12px; }
.rg-b-btn-inline { background:none; border:none; cursor:pointer; padding:3px 6px; border-radius:4px; opacity:0.5; transition:all 0.15s; display:inline-flex; align-items:center; }
.rg-b-btn-inline:hover { opacity:1; }
.rg-b-btn-inline.danger { color:#ef4444; }
.rg-b-btn-inline.danger:hover { background:rgba(239,68,68,0.08); }

/* ── Form grid (default 2-col) ── */
.rg-b-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px 16px; }
.rg-b-form-icon { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }

/* ── Detail page header (card-style) ── */
.rg-b-detail-hero { background:var(--rg-bg-card); border:1px solid var(--rg-border); border-radius:14px; padding:24px; margin-bottom:20px; display:flex; align-items:center; gap:16px; }
.rg-b-detail-hero-avatar { width:52px; height:52px; border-radius:50%; background:var(--rg-bg-elevated); display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:700; color:var(--rg-text-muted); flex-shrink:0; letter-spacing:-0.02em; }
.rg-b-detail-hero-icon { width:48px; height:48px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.rg-b-detail-hero-body { flex:1; min-width:0; }
.rg-b-detail-hero-title { font-size:20px; font-weight:700; color:var(--rg-text-primary); margin:0; letter-spacing:-0.01em; }
.rg-b-detail-hero-sub { font-size:13px; color:var(--rg-text-muted); margin-top:3px; }
.rg-b-detail-hero-actions { display:flex; gap:8px; flex-shrink:0; align-items:center; }

/* ── Info grid (detail view key-value pairs) ── */
.rg-b-info-grid { display:flex; flex-direction:column; gap:0; padding:4px 0; }
.rg-b-info-row { display:flex; justify-content:space-between; align-items:center; padding:10px 0; border-bottom:1px solid var(--rg-border); font-size:13px; color:var(--rg-text-primary); }
.rg-b-info-row:last-child { border-bottom:none; }
.rg-b-info-label { color:var(--rg-text-muted); font-size:12px; font-weight:500; flex-shrink:0; }

/* ── Detail section card ── */
.rg-b-section { background:var(--rg-bg-card); border:1px solid var(--rg-border); border-radius:12px; overflow:hidden; margin-bottom:16px; }
.rg-b-section-head { padding:16px 20px 0; display:flex; align-items:center; justify-content:space-between; }
.rg-b-section-head strong { font-size:14px; font-weight:600; color:var(--rg-text-primary); }
.rg-b-section-head .rg-b-section-count { font-size:12px; color:var(--rg-text-muted); font-weight:400; margin-left:6px; }
.rg-b-section-body { padding:12px 20px 16px; }
.rg-b-section-empty { padding:32px 20px; text-align:center; color:var(--rg-text-muted); font-size:13px; }

/* ── Summary metric (big number cards) ── */
.rg-b-summary-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:16px; margin-bottom:20px; }
.rg-b-summary-card { background:var(--rg-bg-card); border:1px solid var(--rg-border); border-radius:12px; padding:20px; text-align:center; }
.rg-b-summary-value { font-size:24px; font-weight:700; color:var(--rg-text-primary); letter-spacing:-0.02em; line-height:1.2; }
.rg-b-summary-value.positive { color:#10b981; }
.rg-b-summary-value.negative { color:#ef4444; }
.rg-b-summary-label { font-size:12px; color:var(--rg-text-muted); margin-top:4px; }

/* ── Detail grid (2-col info sections) ── */
.rg-b-detail-2col { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }

/* ── Form page wrapper ── */
.rg-b-form-page { max-width:860px; }
.rg-b-form-page .rg-b-form-section { background:var(--rg-bg-card); border:1px solid var(--rg-border); border-radius:12px; padding:20px 24px; margin-bottom:16px; }
.rg-b-form-page .rg-b-form-section:last-of-type { margin-bottom:0; }

/* ── Form footer (actions row with top border) ── */
.rg-b-form-footer { display:flex; justify-content:flex-end; gap:10px; padding-top:20px; margin-top:4px; }

/* ── Checkbox in forms ── */
.rg-b-checkbox-row { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--rg-text-secondary); cursor:pointer; padding:8px 0; }
.rg-b-checkbox-row input[type="checkbox"] { width:16px; height:16px; accent-color:#10b981; cursor:pointer; }

/* ── Link text ── */
.rg-b-link { color:#3b82f6; cursor:pointer; text-decoration:none; transition:color 0.15s; }
.rg-b-link:hover { color:#2563eb; text-decoration:underline; }

/* ── Notes block ── */
.rg-b-notes { margin-top:12px; padding-top:12px; border-top:1px solid var(--rg-border); }
.rg-b-notes-label { font-size:12px; font-weight:500; color:var(--rg-text-muted); margin-bottom:4px; }
.rg-b-notes-text { font-size:13px; color:var(--rg-text-secondary); line-height:1.6; white-space:pre-line; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .rg-b-metrics { grid-template-columns:repeat(2, 1fr); }
    .rg-b-form-grid-2,
    .rg-b-form-grid-3,
    .rg-b-form-grid-4,
    .rg-b-form-grid { grid-template-columns:1fr; }
    .rg-b-detail-header { flex-direction:column; }
    .rg-b-detail-cover { width:100%; min-height:160px; }
    .rg-b-detail-top { flex-direction:column; }
    .rg-b-detail-actions { width:100%; }
    .rg-b-detail-grid { grid-template-columns:1fr !important; }
    .rg-b-detail-hero { flex-wrap:wrap; }
    .rg-b-detail-hero-actions { width:100%; justify-content:flex-end; }
    .rg-b-detail-2col { grid-template-columns:1fr; }
    .rg-b-summary-grid { grid-template-columns:1fr; }
    .rg-b-table { font-size:12px; }
    .rg-b-table thead th,
    .rg-b-table tbody td { padding:8px 10px; }
    .rg-b-page-header { flex-wrap:wrap; }
    .rg-b-section-header { flex-direction:column; align-items:stretch; }
}
@media (max-width: 480px) {
    .rg-b-metrics { grid-template-columns:1fr; }
    .rg-b-amenity-grid { grid-template-columns:1fr 1fr; }
}


/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES — Login, Register, Forgot Password, Reset Password
   Standalone full-page layouts matching the design system
   ═══════════════════════════════════════════════════════════════ */

.rg-auth-page {
    min-height: 100vh;
    display: flex;
    background: var(--rg-bg-base);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--rg-text-primary);
    line-height: 1.5;
}
[dir="rtl"] .rg-auth-page {
    font-family: 'Noto Kufi Arabic', 'DM Sans', -apple-system, sans-serif;
}

/* ── Left Panel (branding / illustration) ── */
.rg-auth-brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    background: linear-gradient(135deg, #0f1629 0%, #0a1020 50%, #0d1a2f 100%);
    position: relative;
    overflow: hidden;
}
.rg-auth-brand::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16,185,129,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.rg-auth-brand-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 24px rgba(16,185,129,0.3);
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}
.rg-auth-brand-title {
    font-size: 28px;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}
.rg-auth-brand-sub {
    font-size: 15px;
    color: #64748b;
    max-width: 320px;
    text-align: center;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}
.rg-auth-brand-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 48px;
    position: relative;
    z-index: 1;
}
.rg-auth-brand-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}
.rg-auth-brand-feature-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(16,185,129,0.1);
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Right Panel (form) ── */
.rg-auth-panel {
    width: 520px;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 56px;
    background: var(--rg-bg-surface);
    border-inline-start: 1px solid var(--rg-border);
    overflow-y: auto;
}
.rg-auth-form-header {
    margin-bottom: 32px;
}
.rg-auth-form-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.rg-auth-form-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--rg-text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.rg-auth-form-subtitle {
    font-size: 14px;
    color: var(--rg-text-muted);
    line-height: 1.6;
}

/* ── Alert Banners ── */
.rg-auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--rg-radius-md);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.5;
    border: 1px solid;
    transition: all 0.3s ease;
}
.rg-auth-alert svg { flex-shrink: 0; margin-top: 1px; }
.rg-auth-alert-error {
    background: rgba(239,68,68,0.08);
    color: #f87171;
    border-color: rgba(239,68,68,0.2);
}
.rg-auth-alert-success {
    background: rgba(16,185,129,0.08);
    color: #34d399;
    border-color: rgba(16,185,129,0.2);
}

/* ── Form Fields ── */
.rg-auth-field {
    margin-bottom: 18px;
}
.rg-auth-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--rg-text-secondary);
    margin-bottom: 6px;
}
.rg-auth-label .required {
    color: #f43f5e;
    margin-inline-start: 2px;
}
.rg-auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.rg-auth-input-icon {
    position: absolute;
    inset-inline-start: 14px;
    color: var(--rg-text-muted);
    pointer-events: none;
    display: flex;
    z-index: 1;
}
.rg-auth-input {
    width: 100%;
    padding: 11px 14px 11px 42px;
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius-md);
    background: var(--rg-bg-base);
    color: var(--rg-text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--rg-transition-fast);
    outline: none;
}
[dir="rtl"] .rg-auth-input { padding: 11px 42px 11px 14px; }
.rg-auth-input:focus {
    border-color: #10b981;
    box-shadow: var(--rg-focus-ring);
    background: var(--rg-bg-surface);
}
.rg-auth-input::placeholder {
    color: var(--rg-text-muted);
    font-size: 13px;
}
.rg-auth-input.has-eye { padding-inline-end: 44px; }

.rg-auth-eye {
    position: absolute;
    inset-inline-end: 4px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--rg-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--rg-radius-sm);
    transition: all var(--rg-transition-fast);
    z-index: 1;
}
.rg-auth-eye:hover { color: var(--rg-text-secondary); background: var(--rg-bg-hover); }

/* ── Form Row (2-col) ── */
.rg-auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ── Strength Meter ── */
.rg-auth-strength {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.rg-auth-strength-track {
    flex: 1;
    height: 4px;
    background: var(--rg-bg-elevated);
    border-radius: 2px;
    overflow: hidden;
}
.rg-auth-strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: all 0.3s ease;
    width: 0%;
}
.rg-auth-strength-text {
    font-size: 11px;
    font-weight: 600;
    min-width: 70px;
    text-align: end;
}

/* ── Checkbox (remember me) ── */
.rg-auth-check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.rg-auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.rg-auth-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #10b981;
    cursor: pointer;
}
.rg-auth-check span {
    font-size: 13px;
    color: var(--rg-text-secondary);
    font-weight: 500;
}
.rg-auth-forgot {
    font-size: 13px;
    color: #10b981;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--rg-transition-fast);
}
.rg-auth-forgot:hover { color: #059669; }

/* ── Buttons ── */
.rg-auth-btn-primary {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: var(--rg-radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--rg-transition-base);
    box-shadow: 0 2px 12px rgba(16,185,129,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.rg-auth-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 4px 20px rgba(16,185,129,0.35);
    transform: translateY(-1px);
}
.rg-auth-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.rg-auth-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rg-spin 0.8s linear infinite;
}
@keyframes rg-spin { to { transform: rotate(360deg); } }

/* ── Footer Links ── */
.rg-auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 13px;
    color: var(--rg-text-muted);
}
.rg-auth-footer a {
    color: #10b981;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--rg-transition-fast);
}
.rg-auth-footer a:hover { color: #059669; }

.rg-auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--rg-text-muted);
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color var(--rg-transition-fast);
}
.rg-auth-back-link:hover { color: var(--rg-text-primary); }

/* ── Divider ── */
.rg-auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--rg-text-muted);
    font-size: 12px;
    font-weight: 500;
}
.rg-auth-divider::before,
.rg-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--rg-border);
}

/* ── Bottom Copyright ── */
.rg-auth-copyright {
    text-align: center;
    margin-top: 48px;
    font-size: 12px;
    color: var(--rg-text-muted);
}

/* ── Auth Responsive ── */
.rg-auth-form .rg-auth-label { display: none; }
.rg-auth-form-header { text-align: center; }
.rg-auth-form-icon { margin-inline: auto; }

/* ── Auth Controls (theme/lang) ── */
.rg-auth-controls {
    position: fixed;
    top: 16px;
    inset-inline-start: 16px;
    inset-inline-end: 16px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    z-index: 100;
}
.rg-auth-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    min-width: 34px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid var(--rg-border);
    background: var(--rg-bg-elevated);
    color: var(--rg-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
}
.rg-auth-ctrl-btn:hover {
    color: var(--rg-text-primary);
    border-color: var(--rg-border-active);
    background: var(--rg-bg-hover);
}
.rg-auth-ctrl-lang { padding: 0 12px; }

/* ═══ Auth Home Link ═══ */
.rg-auth-ctrl-home {
    text-decoration: none;
    padding: 0 12px;
    color: var(--rg-text-muted);
}
.rg-auth-ctrl-home svg { flex-shrink: 0; }
.rg-auth-ctrl-home:hover { color: var(--rg-text-primary); }

/* ═══ Login Method Tabs ═══ */
.rg-auth-tabs {
    display: flex;
    background: var(--rg-bg-elevated, #151d2e);
    border-radius: 10px;
    padding: 3px;
    border: 1px solid var(--rg-border, #1e293b);
    margin-bottom: 20px;
    gap: 3px;
}
.rg-auth-tab {
    flex: 1;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--rg-text-muted, #94a3b8);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    font-family: inherit;
}
.rg-auth-tab:hover { color: var(--rg-text-primary, #e2e8f0); }
.rg-auth-tab.active {
    background: var(--rg-accent, #10b981);
    color: #fff;
    box-shadow: 0 1px 3px rgba(16,185,129,0.3);
}

/* ═══ Tab Panels — must override form default display ═══ */
.rg-auth-panel .rg-auth-tab-panel { display: none !important; }
.rg-auth-panel .rg-auth-tab-panel.active { display: block !important; }

/* ═══ Magic Link Description ═══ */
.rg-auth-magic-desc {
    font-size: 13px;
    color: var(--rg-text-secondary, #94a3b8);
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 12px 14px;
    background: rgba(16,185,129,0.06);
    border-radius: 8px;
    border: 1px solid rgba(16,185,129,0.12);
}

/* ═══════════════════════════════════════
   LIGHT THEME
   ═══════════════════════════════════════ */
.rg-theme-light {
    --rg-bg-base: #f8fafc;
    --rg-bg-surface: #ffffff;
    --rg-bg-elevated: #f1f5f9;
    --rg-bg-hover: #e2e8f0;
    --rg-bg-overlay: rgba(0, 0, 0, 0.4);

    --rg-border: rgba(0, 0, 0, 0.08);
    --rg-border-active: rgba(0, 0, 0, 0.18);

    --rg-text-primary: #0f172a;
    --rg-text-secondary: #334155;
    --rg-text-muted: #64748b;

    --rg-grid: rgba(0, 0, 0, 0.04);

    --rg-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --rg-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --rg-shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.1);
    --rg-shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.12);

    --rg-focus-ring: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Auth brand panel — light theme */
.rg-theme-light .rg-auth-brand {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0fdfa 100%);
}
.rg-theme-light .rg-auth-brand::before {
    background: radial-gradient(circle, rgba(16,185,129,0.08) 0%, transparent 70%);
}
.rg-theme-light .rg-auth-brand-title { color: #0f172a; }
.rg-theme-light .rg-auth-brand-sub { color: #475569; }
.rg-theme-light .rg-auth-brand-feature { color: #334155; }
.rg-theme-light .rg-auth-brand-feature-icon {
    background: rgba(16,185,129,0.1);
    color: #059669;
}
/* Auth panel — light overrides */
.rg-theme-light .rg-auth-panel {
    background: #fff;
    border-color: rgba(0,0,0,0.06);
}
.rg-theme-light .rg-auth-input {
    background: #f8fafc;
    border-color: rgba(0,0,0,0.1);
    color: #0f172a;
}
.rg-theme-light .rg-auth-input:focus {
    background: #fff;
    border-color: #10b981;
}
.rg-theme-light .rg-auth-input::placeholder { color: #94a3b8; }
.rg-theme-light .rg-auth-alert-error {
    background: rgba(239,68,68,0.06);
    color: #dc2626;
    border-color: rgba(239,68,68,0.15);
}
.rg-theme-light .rg-auth-alert-success {
    background: rgba(16,185,129,0.06);
    color: #059669;
    border-color: rgba(16,185,129,0.15);
}

@media (max-width: 1024px) {
    .rg-auth-brand { display: none; }
    .rg-auth-panel {
        width: 100%;
        min-width: 0;
        border-inline-start: none;
    }
}
@media (max-width: 600px) {
    .rg-auth-panel { padding: 40px 24px; }
    .rg-auth-row { grid-template-columns: 1fr; }
    .rg-auth-form-title { font-size: 20px; }
    .rg-auth-check-row { flex-direction: column; align-items: flex-start; gap: 12px; }
    .rg-auth-controls { top: 10px; inset-inline-start: 10px; inset-inline-end: 10px; }
    .rg-auth-ctrl-home span { display: none; }
}
