/* =========================================================
   RideGo Admin — Design System
   ========================================================= */

:root {
    --rg-primary: #4f46e5;
    --rg-primary-600: #4338ca;
    --rg-primary-50: #eef2ff;
    --rg-primary-100: #e0e7ff;
    --rg-sidebar-bg: #0f172a;
    --rg-sidebar-bg-2: #111a30;
    --rg-sidebar-text: #94a3b8;
    --rg-sidebar-active: #4f46e5;
    --rg-bg: #f3f5fa;
    --rg-card: #ffffff;
    --rg-border: #e7eaf3;
    --rg-text: #1e293b;
    --rg-muted: #64748b;
    --rg-success: #16a34a;
    --rg-success-bg: #dcfce7;
    --rg-danger: #dc2626;
    --rg-danger-bg: #fee2e2;
    --rg-warning: #d97706;
    --rg-warning-bg: #fef3c7;
    --rg-info: #0284c7;
    --rg-info-bg: #e0f2fe;
    --rg-secondary: #64748b;
    --rg-secondary-bg: #e2e8f0;
    --rg-radius: 14px;
    --rg-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --rg-shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .16);
    --rg-sidebar-w: 264px;
    --rg-sidebar-w-collapsed: 78px;
    --rg-navbar-h: 64px;
    --rg-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { -webkit-tap-highlight-color: transparent; }

html { font-size: 15px; }

body.rg-body {
    font-family: var(--rg-font);
    background: var(--rg-bg);
    color: var(--rg-text);
    min-height: 100vh;
}

/* Scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8cede; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aab3c8; border: 2px solid transparent; background-clip: content-box; }

/* ============ Layout shell ============ */
.rg-app { display: flex; min-height: 100vh; }

.rg-main {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: var(--rg-sidebar-w);
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease;
}

.rg-content { padding: 1.25rem 1.5rem 2rem; flex: 1; }
@media (max-width: 575.98px) { .rg-content { padding: 1rem .85rem 1.5rem; } }

/* ============ Sidebar ============ */
.rg-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rg-sidebar-w);
    background: linear-gradient(180deg, var(--rg-sidebar-bg) 0%, var(--rg-sidebar-bg-2) 100%);
    color: var(--rg-sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width .25s ease, transform .25s ease;
    overflow: hidden;
}

.rg-sidebar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1rem 1.1rem;
    height: var(--rg-navbar-h);
    flex: 0 0 auto;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.rg-logo {
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #6366f1, #4f46e5 55%, #4338ca);
    display: grid; place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -.02em;
    box-shadow: 0 4px 14px rgba(79, 70, 229, .45);
    flex: 0 0 auto;
}

.rg-brand-name { color: #fff; font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em; line-height: 1.1; white-space: nowrap; }
.rg-brand-sub { font-size: .68rem; color: #64748b; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }

.rg-nav { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: .85rem .75rem 1rem; }
.rg-nav::-webkit-scrollbar-thumb { background: rgba(148,163,184,.25); border: 2px solid transparent; background-clip: content-box; }

.rg-nav-label {
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #526078;
    padding: .9rem .65rem .35rem;
    white-space: nowrap;
}

.rg-nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .58rem .68rem;
    margin-bottom: .12rem;
    border-radius: 10px;
    color: var(--rg-sidebar-text);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    transition: background .15s ease, color .15s ease;
}

.rg-nav-link i { width: 21px; text-align: center; font-size: .98rem; flex: 0 0 auto; }
.rg-nav-link:hover { background: rgba(148, 163, 184, .1); color: #e2e8f0; }

.rg-nav-link.active {
    background: linear-gradient(90deg, rgba(79, 70, 229, .92), rgba(79, 70, 229, .65));
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, .35);
}

.rg-nav-link .rg-count {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: .66rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .14rem .45rem;
    line-height: 1;
}

.rg-nav-dropdown { display: none; flex-direction: column; }
.rg-nav-group.open > .rg-nav-dropdown { display: flex; }
.rg-nav-group > .rg-nav-link .fa-chevron-down { margin-left: auto; font-size: .7rem; transition: transform .2s ease; }
.rg-nav-group.open > .rg-nav-link .fa-chevron-down { transform: rotate(180deg); }
.rg-nav-group .rg-nav-dropdown .rg-nav-link { padding-left: 2.55rem; font-size: .86rem; }

.rg-sidebar-footer {
    flex: 0 0 auto;
    border-top: 1px solid rgba(148, 163, 184, .12);
    padding: .8rem;
}

.rg-user-chip {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .5rem;
    border-radius: 10px;
    cursor: pointer;
}
.rg-user-chip:hover { background: rgba(148, 163, 184, .1); }
.rg-user-chip .rg-uc-name { color: #e2e8f0; font-size: .84rem; font-weight: 600; line-height: 1.15; white-space: nowrap; }
.rg-user-chip .rg-uc-role { color: #64748b; font-size: .7rem; white-space: nowrap; }

/* Collapsed (desktop) */
@media (min-width: 992px) {
    body.rg-collapsed .rg-sidebar { width: var(--rg-sidebar-w-collapsed); }
    body.rg-collapsed .rg-main { margin-left: var(--rg-sidebar-w-collapsed); }
    body.rg-collapsed .rg-brand-name,
    body.rg-collapsed .rg-brand-sub,
    body.rg-collapsed .rg-nav-label,
    body.rg-collapsed .rg-nav-link span.rg-link-text,
    body.rg-collapsed .rg-nav-link .rg-count,
    body.rg-collapsed .rg-nav-link .fa-chevron-down,
    body.rg-collapsed .rg-uc-text,
    body.rg-collapsed .rg-nav-dropdown { display: none; }
    body.rg-collapsed .rg-sidebar-brand { justify-content: center; padding: 1rem .5rem; }
    body.rg-collapsed .rg-nav-link { justify-content: center; padding: .62rem; }
    body.rg-collapsed .rg-user-chip { justify-content: center; }
    body.rg-collapsed .rg-nav-group > .rg-nav-link .fa-chevron-down { display: none; }

    /* Tooltips in collapsed mode */
    body.rg-collapsed .rg-nav-link { overflow: visible; }
    body.rg-collapsed .rg-nav-link::after {
        content: attr(data-tip);
        position: absolute;
        left: calc(100% + 14px);
        top: 50%;
        transform: translateY(-50%) translateX(-4px);
        background: #1e293b;
        color: #f1f5f9;
        font-size: .74rem;
        font-weight: 600;
        padding: .38rem .6rem;
        border-radius: 8px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s ease, transform .15s ease;
        box-shadow: var(--rg-shadow-lg);
        z-index: 1060;
    }
    body.rg-collapsed .rg-nav-link::before {
        content: "";
        position: absolute;
        left: calc(100% + 7px);
        top: 50%;
        transform: translateY(-50%) translateX(-4px);
        border: 5px solid transparent;
        border-right-color: #1e293b;
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s ease, transform .15s ease;
    }
    body.rg-collapsed .rg-nav-link:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
    body.rg-collapsed .rg-nav-link:hover::before { opacity: 1; transform: translateY(-50%) translateX(0); }
}

/* Mobile off-canvas */
.rg-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
    z-index: 1035;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

@media (max-width: 991.98px) {
    .rg-sidebar { transform: translateX(-105%); width: 280px !important; }
    body.rg-mobile-open .rg-sidebar { transform: translateX(0); box-shadow: var(--rg-shadow-lg); }
    body.rg-mobile-open .rg-sidebar-overlay { opacity: 1; pointer-events: auto; }
    .rg-main { margin-left: 0 !important; }
}

/* ============ Navbar ============ */
.rg-navbar {
    height: var(--rg-navbar-h);
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rg-border);
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}
@media (max-width: 575.98px) { .rg-navbar { padding: 0 .85rem; gap: .5rem; } }

.rg-icon-btn {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--rg-muted);
    font-size: 1rem;
    position: relative;
    transition: all .15s ease;
}
.rg-icon-btn:hover { background: #f1f5f9; color: var(--rg-text); }
.rg-icon-btn .rg-dot {
    position: absolute;
    top: 7px; right: 8px;
    width: 8px; height: 8px;
    background: #ef4444;
    border-radius: 999px;
    border: 2px solid #fff;
}
.rg-icon-btn .rg-badge-num {
    position: absolute;
    top: -4px; right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: .58rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .15rem .32rem;
    line-height: 1;
    border: 1.5px solid #fff;
}

.rg-search {
    position: relative;
    flex: 0 1 420px;
    margin-left: auto;
    order: 5;
}
.rg-search input {
    width: 100%;
    border: 1px solid var(--rg-border);
    background: #f6f8fc;
    border-radius: 10px;
    padding: .5rem 1rem .5rem 2.4rem;
    font-size: .875rem;
    color: var(--rg-text);
    transition: all .15s ease;
}
.rg-search input:focus { outline: none; border-color: var(--rg-primary); background: #fff; box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.rg-search > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: .85rem; }
.rg-search kbd {
    position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
    font-size: .64rem; color: #94a3b8; border: 1px solid var(--rg-border);
    border-radius: 5px; padding: .1rem .35rem; background: #fff;
    font-family: inherit;
}

.rg-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--rg-border);
    border-radius: 12px;
    box-shadow: var(--rg-shadow-lg);
    max-height: 380px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
}
.rg-search-results.open { display: block; }
.rg-sr-group { padding: .5rem .75rem .25rem; font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #94a3b8; }
.rg-sr-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; text-decoration: none; color: var(--rg-text); font-size: .85rem; }
.rg-sr-item:hover { background: #f6f8fc; }
.rg-sr-item i { color: var(--rg-primary); width: 18px; text-align: center; }
.rg-sr-item small { color: var(--rg-muted); margin-left: auto; }
.rg-sr-empty { padding: 1rem; text-align: center; color: var(--rg-muted); font-size: .84rem; }

@media (max-width: 767.98px) {
    .rg-search { flex: 1 1 auto; order: 6; }
    .rg-search kbd { display: none; }
}

/* Dropdown menus (navbar) */
.rg-dd { position: relative; }
.rg-dd-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 320px;
    background: #fff;
    border: 1px solid var(--rg-border);
    border-radius: 14px;
    box-shadow: var(--rg-shadow-lg);
    z-index: 1050;
    padding: .5rem;
}
.rg-dd-menu.rg-dd-wide { min-width: 360px; }
.rg-dd-head { display: flex; align-items: center; justify-content: space-between; padding: .45rem .7rem .6rem; }
.rg-dd-head h6 { margin: 0; font-size: .86rem; font-weight: 700; }
.rg-dd-item {
    display: flex;
    gap: .65rem;
    padding: .6rem .7rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--rg-text);
    font-size: .84rem;
    align-items: flex-start;
}
.rg-dd-item:hover { background: #f6f8fc; }
.rg-dd-item .rg-ico {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: grid; place-items: center;
    font-size: .85rem;
    flex: 0 0 auto;
}
.rg-dd-item b { display: block; font-weight: 600; font-size: .83rem; }
.rg-dd-item small { color: var(--rg-muted); font-size: .74rem; line-height: 1.35; display: block; }
.rg-dd-item time { color: #94a3b8; font-size: .68rem; margin-left: auto; white-space: nowrap; }
.rg-dd-foot { border-top: 1px solid var(--rg-border); margin-top: .45rem; padding-top: .45rem; }
.rg-dd-foot a { display: block; text-align: center; font-size: .8rem; font-weight: 600; color: var(--rg-primary); padding: .4rem; border-radius: 8px; }
.rg-dd-foot a:hover { background: var(--rg-primary-50); }
.rg-dd-sep { border-top: 1px solid var(--rg-border); margin: .35rem .4rem; }
.rg-dd-action {
    display: flex; align-items: center; gap: .6rem;
    width: 100%;
    padding: .55rem .7rem;
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--rg-text);
    text-decoration: none;
    background: none;
    border: 0;
    text-align: left;
    cursor: pointer;
}
.rg-dd-action:hover { background: #f6f8fc; }
.rg-dd-action.danger { color: var(--rg-danger); }
.rg-dd-action.danger:hover { background: var(--rg-danger-bg); }

/* Profile chip */
.rg-profile-chip {
    display: flex; align-items: center; gap: .6rem;
    padding: .3rem .55rem .3rem .3rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    transition: all .15s ease;
}
.rg-profile-chip:hover { background: #f1f5f9; }
.rg-profile-chip .rg-pc-name { font-size: .84rem; font-weight: 600; color: var(--rg-text); line-height: 1.1; }
.rg-profile-chip .rg-pc-role { font-size: .68rem; color: var(--rg-muted); }
@media (max-width: 767.98px) { .rg-profile-chip .rg-pc-text { display: none; } }

/* ============ Page header / breadcrumb ============ */
.rg-breadcrumb {
    display: flex; align-items: center; gap: .45rem;
    font-size: .78rem; color: var(--rg-muted);
    margin-bottom: .35rem;
}
.rg-breadcrumb a { color: var(--rg-muted); text-decoration: none; }
.rg-breadcrumb a:hover { color: var(--rg-primary); }
.rg-breadcrumb .sep { color: #cbd5e1; font-size: .66rem; }
.rg-breadcrumb .current { color: var(--rg-text); font-weight: 600; }

.rg-page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1.1rem;
}
.rg-page-head h1 { font-size: 1.35rem; font-weight: 750; letter-spacing: -.02em; margin: 0; }
.rg-page-head .rg-sub { color: var(--rg-muted); font-size: .85rem; margin: .15rem 0 0; }
.rg-page-head .rg-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ============ Cards ============ */
.rg-card {
    background: var(--rg-card);
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius);
    box-shadow: var(--rg-shadow);
}
.rg-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; flex-wrap: wrap;
    padding: 1rem 1.15rem .75rem;
}
.rg-card-head h5 { font-size: .98rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.rg-card-head .rg-card-sub { font-size: .78rem; color: var(--rg-muted); margin-top: .1rem; }
.rg-card-body { padding: 1.15rem; }
.rg-card-body.flush { padding: 0; }
.rg-card-foot {
    border-top: 1px solid var(--rg-border);
    padding: .75rem 1.15rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; flex-wrap: wrap;
    font-size: .8rem; color: var(--rg-muted);
    background: #fafbfe;
    border-radius: 0 0 var(--rg-radius) var(--rg-radius);
}

/* ============ Stat cards ============ */
.rg-stat {
    display: flex; align-items: flex-start; gap: .9rem;
    background: var(--rg-card);
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius);
    box-shadow: var(--rg-shadow);
    padding: 1.05rem 1.15rem;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.rg-stat::after {
    content: "";
    position: absolute;
    right: -30px; top: -30px;
    width: 95px; height: 95px;
    border-radius: 50%;
    background: currentColor;
    opacity: .05;
}
.rg-stat-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 1.15rem;
    flex: 0 0 auto;
}
.rg-stat-label { font-size: .78rem; color: var(--rg-muted); font-weight: 600; }
.rg-stat-value { font-size: 1.42rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.rg-stat-foot { display: flex; align-items: center; gap: .45rem; margin-top: .3rem; font-size: .74rem; color: var(--rg-muted); flex-wrap: wrap; }

.rg-delta { font-weight: 700; font-size: .72rem; border-radius: 999px; padding: .12rem .45rem; display: inline-flex; align-items: center; gap: .25rem; }
.rg-delta.up { color: var(--rg-success); background: var(--rg-success-bg); }
.rg-delta.down { color: var(--rg-danger); background: var(--rg-danger-bg); }
.rg-delta.flat { color: var(--rg-secondary); background: var(--rg-secondary-bg); }

/* Tones */
.tone-primary { color: var(--rg-primary); background: var(--rg-primary-50); }
.tone-success { color: var(--rg-success); background: var(--rg-success-bg); }
.tone-danger  { color: var(--rg-danger);  background: var(--rg-danger-bg); }
.tone-warning { color: var(--rg-warning); background: var(--rg-warning-bg); }
.tone-info    { color: var(--rg-info);    background: var(--rg-info-bg); }
.tone-dark    { color: #334155;           background: var(--rg-secondary-bg); }
.tone-neutral { color: var(--rg-muted);   background: #f1f5f9; }

/* ============ Badges ============ */
.rg-badge {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .72rem; font-weight: 700;
    border-radius: 999px;
    padding: .22rem .6rem;
    line-height: 1.1;
    white-space: nowrap;
}
.rg-badge .rg-badge-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.rg-badge.pulse .rg-badge-dot { animation: rg-pulse 1.6s ease infinite; }
@keyframes rg-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, .45); }
    50% { box-shadow: 0 0 0 4px rgba(79, 70, 229, 0); }
}

/* ============ Avatars ============ */
.rg-avatar {
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    flex: 0 0 auto;
    user-select: none;
    position: relative;
    letter-spacing: .02em;
}
.rg-avatar.av-sm { width: 32px; height: 32px; font-size: .7rem; }
.rg-avatar.av-md { width: 40px; height: 40px; font-size: .82rem; }
.rg-avatar.av-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.rg-avatar.av-xl { width: 84px; height: 84px; font-size: 1.7rem; }

.at-1 { background: linear-gradient(135deg, #6366f1, #4338ca); }
.at-2 { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.at-3 { background: linear-gradient(135deg, #10b981, #047857); }
.at-4 { background: linear-gradient(135deg, #f59e0b, #b45309); }
.at-5 { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.at-6 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.at-7 { background: linear-gradient(135deg, #ec4899, #be185d); }
.at-8 { background: linear-gradient(135deg, #14b8a6, #0f766e); }

.rg-avatar .rg-status-dot {
    position: absolute;
    bottom: 0; right: 0;
    width: 11px; height: 11px;
    border-radius: 999px;
    border: 2.5px solid #fff;
    background: #94a3b8;
}
.rg-avatar .rg-status-dot.online { background: #22c55e; }
.rg-avatar .rg-status-dot.busy { background: #f59e0b; }
.rg-avatar .rg-status-dot.offline { background: #94a3b8; }

/* User cell (avatar + name + sub) */
.rg-user-cell { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.rg-user-cell .rg-uc-name { font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg-user-cell .rg-uc-sub { font-size: .72rem; color: var(--rg-muted); white-space: nowrap; }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.rg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .845rem;
    min-width: 720px;
}
.rg-table thead th {
    text-align: left;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8592a8;
    background: #f8fafd;
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--rg-border);
    white-space: nowrap;
}
.rg-table tbody td {
    padding: .72rem 1rem;
    border-bottom: 1px solid #f0f3f9;
    vertical-align: middle;
    color: var(--rg-text);
}
.rg-table tbody tr { transition: background .12s ease; }
.rg-table tbody tr:hover { background: #f8faff; }
.rg-table tbody tr:last-child td { border-bottom: 0; }
.rg-table .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .78rem; color: #475569; }
.rg-table .num { font-variant-numeric: tabular-nums; }
.rg-table .strong { font-weight: 650; }

/* Action icon buttons in tables */
.rg-tbl-actions { display: flex; gap: .3rem; }
.rg-tbl-actions .rg-icon-btn { width: 30px; height: 30px; border-radius: 8px; font-size: .82rem; }

/* ============ Buttons ============ */
.btn-rg {
    display: inline-flex; align-items: center; gap: .45rem;
    border-radius: 10px;
    font-size: .84rem;
    font-weight: 600;
    padding: .5rem .95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn-rg:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--rg-primary); color: #fff; box-shadow: 0 2px 8px rgba(79, 70, 229, .3); }
.btn-primary:hover { background: var(--rg-primary-600); color: #fff; box-shadow: 0 4px 14px rgba(79, 70, 229, .4); }
.btn-outline { background: #fff; color: var(--rg-text); border-color: #d8deeb; }
.btn-outline:hover { background: #f6f8fc; border-color: #c3ccdd; color: var(--rg-text); }
.btn-soft { background: var(--rg-primary-50); color: var(--rg-primary-600); }
.btn-soft:hover { background: var(--rg-primary-100); color: var(--rg-primary-600); }
.btn-danger-soft { background: var(--rg-danger-bg); color: var(--rg-danger); }
.btn-danger-soft:hover { background: #fecaca; }
.btn-success-soft { background: var(--rg-success-bg); color: var(--rg-success); }
.btn-success-soft:hover { background: #bbf7d0; }
.btn-sm { padding: .34rem .7rem; font-size: .78rem; border-radius: 8px; }

/* ============ Forms ============ */
.rg-form-label { font-size: .78rem; font-weight: 650; color: #475569; margin-bottom: .35rem; display: block; }
.rg-form-input, .rg-form-select, .rg-form-textarea {
    width: 100%;
    border: 1px solid #d8deeb;
    border-radius: 10px;
    padding: .5rem .8rem;
    font-size: .855rem;
    color: var(--rg-text);
    background: #fff;
    transition: all .15s ease;
}
.rg-form-input:focus, .rg-form-select:focus, .rg-form-textarea:focus {
    outline: none;
    border-color: var(--rg-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.rg-form-input::placeholder { color: #a3adc2; }
.rg-form-hint { font-size: .72rem; color: #94a3b8; margin-top: .3rem; }

/* Filter bar */
.rg-filterbar {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    align-items: center;
    padding: .85rem 1.15rem;
    border-bottom: 1px solid var(--rg-border);
    background: #fafbfe;
    border-radius: var(--rg-radius) var(--rg-radius) 0 0;
}
.rg-filterbar .rg-search-mini { position: relative; flex: 0 1 260px; min-width: 180px; }
.rg-filterbar .rg-search-mini i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: .78rem; }
.rg-filterbar .rg-search-mini input {
    width: 100%;
    border: 1px solid #d8deeb;
    border-radius: 9px;
    padding: .45rem .75rem .45rem 2.1rem;
    font-size: .82rem;
    background: #fff;
}
.rg-filterbar .rg-search-mini input:focus { outline: none; border-color: var(--rg-primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.rg-filterbar .rg-filter-select {
    border: 1px solid #d8deeb;
    border-radius: 9px;
    padding: .45rem .7rem;
    font-size: .8rem;
    color: #475569;
    background: #fff;
    min-width: 130px;
}
.rg-filterbar .rg-filter-select:focus { outline: none; border-color: var(--rg-primary); }
.rg-filterbar .rg-spacer { flex: 1 1 auto; }
.rg-date-range {
    display: flex; align-items: center; gap: .4rem;
    border: 1px solid #d8deeb; border-radius: 9px;
    padding: .4rem .7rem; font-size: .8rem; color: #475569;
    background: #fff; cursor: pointer;
    white-space: nowrap;
}
.rg-date-range input { border: 0; width: 96px; font-size: .8rem; color: #475569; background: transparent; }
.rg-date-range input:focus { outline: none; }

/* Tom select in filterbars */
.ts-wrapper .ts-control { border-radius: 9px !important; border: 1px solid #d8deeb !important; min-height: 36px; font-size: .82rem !important; background: #fff; }
.ts-wrapper .ts-control input { font-size: .82rem !important; }
.ts-wrapper.multi .ts-control { padding-bottom: 6px; }
.ts-wrapper .ts-dropdown { border-radius: 10px; border: 1px solid #d8deeb; font-size: .82rem; box-shadow: var(--rg-shadow-lg); }

/* ============ Tabs ============ */
.rg-tabs {
    display: flex;
    gap: .2rem;
    border-bottom: 1.5px solid var(--rg-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.rg-tabs::-webkit-scrollbar { display: none; }
.rg-tab {
    padding: .6rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--rg-muted);
    border: 0;
    background: none;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1.5px;
    transition: color .15s ease;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}
.rg-tab:hover { color: var(--rg-text); }
.rg-tab.active { color: var(--rg-primary); border-bottom-color: var(--rg-primary); }
.rg-tab .rg-tab-count {
    background: var(--rg-secondary-bg);
    color: var(--rg-secondary);
    font-size: .68rem;
    font-weight: 700;
    border-radius: 999px;
    padding: .1rem .42rem;
}
.rg-tab.active .rg-tab-count { background: var(--rg-primary-50); color: var(--rg-primary); }

/* Pill segmented control (range switchers) */
.rg-seg {
    display: inline-flex;
    background: #eef1f7;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.rg-seg button {
    border: 0;
    background: transparent;
    font-size: .76rem;
    font-weight: 650;
    color: var(--rg-muted);
    padding: .32rem .72rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
}
.rg-seg button:hover { color: var(--rg-text); }
.rg-seg button.active { background: #fff; color: var(--rg-primary); box-shadow: 0 1px 4px rgba(16,24,40,.12); }

/* ============ Profile card (detail headers) ============ */
.rg-profile-card {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1.25rem 1.4rem;
    flex-wrap: wrap;
}
.rg-profile-card .rg-pc-id { font-size: .74rem; color: var(--rg-muted); font-family: ui-monospace, monospace; }
.rg-profile-card h3 { font-size: 1.15rem; font-weight: 750; margin: .1rem 0 .35rem; letter-spacing: -.01em; }
.rg-profile-card .rg-pc-badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.rg-profile-card .rg-pc-actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 575.98px) { .rg-profile-card .rg-pc-actions { margin-left: 0; width: 100%; } }

/* Quick stat strip on detail pages */
.rg-qstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 991.98px) { .rg-qstats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .rg-qstats { grid-template-columns: repeat(2, 1fr); gap: .7rem; } }
.rg-qstat { padding: .85rem 1rem; }
.rg-qstat .rg-qs-label { font-size: .72rem; color: var(--rg-muted); font-weight: 600; }
.rg-qstat .rg-qs-value { font-size: 1.12rem; font-weight: 750; letter-spacing: -.01em; }
.rg-qstat .rg-qs-sub { font-size: .7rem; color: var(--rg-muted); }

/* ============ Detail info grid ============ */
.rg-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem 2rem; }
@media (max-width: 575.98px) { .rg-info-grid { grid-template-columns: 1fr; } }
.rg-info-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .5rem 0;
    border-bottom: 1px dashed #eef1f7;
    font-size: .84rem;
}
.rg-info-item:last-child { border-bottom: 0; }
.rg-info-item .rg-il { color: var(--rg-muted); flex: 0 0 auto; }
.rg-info-item .rigv { font-weight: 600; text-align: right; word-break: break-word; }

/* ============ Timeline ============ */
.rg-timeline { position: relative; padding-left: 1.6rem; }
.rg-timeline::before {
    content: "";
    position: absolute;
    left: 11px; top: 6px; bottom: 6px;
    width: 2px;
    background: #e5e9f2;
    border-radius: 2px;
}
.rg-tl-item { position: relative; padding-bottom: 1.15rem; }
.rg-tl-item:last-child { padding-bottom: 0; }
.rg-tl-item .rg-tl-dot {
    position: absolute;
    left: -1.6rem;
    top: 2px;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: .62rem;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 1.5px currentColor;
}
.rg-tl-item .rg-tl-time { font-size: .7rem; color: #94a3b8; font-weight: 600; }
.rg-tl-item .rg-tl-title { font-size: .87rem; font-weight: 650; margin: .1rem 0; }
.rg-tl-item .rg-tl-desc { font-size: .78rem; color: var(--rg-muted); }
.rg-tl-item.pending .rg-tl-dot { background: #fff; color: #cbd5e1; }
.rg-tl-item.pending .rg-tl-title { color: #94a3b8; }

/* Live feed */
.rg-feed-item { display: flex; gap: .75rem; padding: .65rem 0; border-bottom: 1px dashed #eef1f7; font-size: .84rem; }
.rg-feed-item:last-child { border-bottom: 0; }
.rg-feed-item .rg-fi-ico {
    width: 32px; height: 32px;
    border-radius: 9px;
    display: grid; place-items: center;
    font-size: .8rem;
    flex: 0 0 auto;
}
.rg-feed-item b { font-weight: 650; }
.rg-feed-item small { display: block; color: var(--rg-muted); font-size: .74rem; }
.rg-feed-item time { margin-left: auto; color: #94a3b8; font-size: .7rem; white-space: nowrap; }

/* ============ Star rating ============ */
.rg-stars { display: inline-flex; gap: 1px; color: #f59e0b; font-size: .78rem; }
.rg-stars .off { color: #e2e8f0; }
.rg-stars.sm { font-size: .68rem; }

.rg-star-row { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: .7rem; font-size: .8rem; }
.rg-star-row .rg-bar { height: 8px; border-radius: 999px; background: #eef1f7; overflow: hidden; }
.rg-star-row .rg-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #fbbf24, #f59e0b); border-radius: 999px; }

/* ============ Map placeholder ============ */
.rg-map {
    position: relative;
    height: 280px;
    border-radius: 12px;
    overflow: hidden;
    background:
        radial-gradient(circle at 25% 30%, rgba(99, 102, 241, .10) 0 2px, transparent 3px),
        repeating-linear-gradient(0deg, transparent 0 46px, rgba(148, 163, 184, .18) 46px 48px),
        repeating-linear-gradient(90deg, transparent 0 46px, rgba(148, 163, 184, .18) 46px 48px),
        linear-gradient(135deg, #e8ecf5 0%, #dfe5f0 50%, #e6ebf4 100%);
    border: 1px solid var(--rg-border);
}
.rg-map .rg-map-road { position: absolute; inset: 0; }
.rg-map .rg-map-label {
    position: absolute;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--rg-border);
    border-radius: 8px;
    font-size: .68rem;
    font-weight: 650;
    padding: .22rem .5rem;
    box-shadow: var(--rg-shadow);
}
.rg-map .rg-pin {
    position: absolute;
    width: 26px; height: 26px;
    border-radius: 50% 50% 50% 4px;
    transform: rotate(-45deg);
    display: grid; place-items: center;
    box-shadow: 0 4px 10px rgba(16, 24, 40, .28);
}
.rg-map .rg-pin > i { transform: rotate(45deg); color: #fff; font-size: .68rem; }
.rg-map .rg-pin.pickup { background: #16a34a; left: 18%; top: 62%; }
.rg-map .rg-pin.drop { background: #dc2626; right: 16%; top: 24%; }
.rg-map .rg-map-eta {
    position: absolute;
    top: 10px; left: 10px;
    display: flex;
    gap: .35rem;
}
.rg-map .rg-map-eta span {
    background: rgba(255,255,255,.94);
    border: 1px solid var(--rg-border);
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    padding: .24rem .6rem;
    box-shadow: var(--rg-shadow);
}
.rg-map .rg-map-foot {
    position: absolute; bottom: 8px; right: 10px;
    font-size: .62rem; color: #8592a8;
    background: rgba(255,255,255,.8);
    padding: .1rem .4rem; border-radius: 6px;
}

/* ============ Document cards ============ */
.rg-doc {
    display: flex; align-items: center; gap: .8rem;
    padding: .8rem .95rem;
    border: 1px solid var(--rg-border);
    border-radius: 12px;
    margin-bottom: .6rem;
    background: #fff;
    transition: box-shadow .15s ease;
}
.rg-doc:hover { box-shadow: var(--rg-shadow); }
.rg-doc .rg-doc-ico {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: grid; place-items: center;
    font-size: .9rem;
    flex: 0 0 auto;
}
.rg-doc .rg-doc-name { font-size: .86rem; font-weight: 650; }
.rg-doc .rg-doc-num { font-size: .72rem; color: var(--rg-muted); font-family: ui-monospace, monospace; }
.rg-doc .rg-doc-actions { margin-left: auto; display: flex; gap: .35rem; align-items: center; }

/* ============ Wallet / payment chips ============ */
.rg-method-ico {
    display: inline-grid; place-items: center;
    width: 30px; height: 30px;
    border-radius: 8px;
    font-size: .8rem;
    margin-right: .5rem;
    vertical-align: middle;
}

/* ============ Empty state ============ */
.rg-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--rg-muted);
}
.rg-empty .rg-empty-ico {
    width: 64px; height: 64px;
    margin: 0 auto 1rem;
    border-radius: 20px;
    display: grid; place-items: center;
    font-size: 1.5rem;
    background: #eef1f7;
    color: #94a3b8;
}
.rg-empty h6 { color: var(--rg-text); font-weight: 700; font-size: .98rem; margin-bottom: .25rem; }
.rg-empty p { font-size: .84rem; max-width: 380px; margin: 0 auto .9rem; }

/* ============ Conversation (complaint thread) ============ */
.rg-thread { display: flex; flex-direction: column; gap: .9rem; }
.rg-msg { max-width: 78%; display: flex; gap: .6rem; }
.rg-msg .rg-msg-av { flex: 0 0 auto; }
.rg-msg .rg-msg-bubble {
    background: #f1f5f9;
    border-radius: 4px 14px 14px 14px;
    padding: .7rem .9rem;
    font-size: .84rem;
}
.rg-msg .rg-msg-bubble .rg-msg-head { display: flex; gap: .5rem; align-items: baseline; margin-bottom: .2rem; }
.rg-msg .rg-msg-bubble b { font-size: .8rem; }
.rg-msg .rg-msg-bubble time { font-size: .68rem; color: #94a3b8; }
.rg-msg.agent { align-self: flex-end; flex-direction: row-reverse; }
.rg-msg.agent .rg-msg-bubble { background: var(--rg-primary-50); border-radius: 14px 4px 14px 14px; }

/* ============ Settings ============ */
.rg-settings-nav { position: sticky; top: calc(var(--rg-navbar-h) + 1rem); }
.rg-settings-nav a {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .8rem;
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--rg-muted);
    text-decoration: none;
    margin-bottom: .15rem;
}
.rg-settings-nav a:hover { background: #eef1f7; color: var(--rg-text); }
.rg-settings-nav a.active { background: var(--rg-primary-50); color: var(--rg-primary-600); }

.rg-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; }
.rg-switch input { opacity: 0; width: 0; height: 0; }
.rg-switch .rg-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #cbd5e1; border-radius: 999px;
    transition: .2s;
}
.rg-switch .rg-slider::before {
    content: ""; position: absolute;
    height: 18px; width: 18px;
    left: 3px; top: 3px;
    background: #fff; border-radius: 50%;
    transition: .2s;
    box-shadow: 0 1px 3px rgba(16,24,40,.25);
}
.rg-switch input:checked + .rg-slider { background: var(--rg-primary); }
.rg-switch input:checked + .rg-slider::before { transform: translateX(18px); }

.rg-setting-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: .9rem 0;
    border-bottom: 1px dashed #eef1f7;
}
.rg-setting-row:last-child { border-bottom: 0; }
.rg-setting-row .rg-sr-title { font-size: .87rem; font-weight: 650; }
.rg-setting-row .rg-sr-desc { font-size: .76rem; color: var(--rg-muted); margin-top: .15rem; max-width: 520px; }

/* ============ Toasts (SweetAlert styled container) ============ */
.rg-swalt-confirm { text-align: center; }

/* ============ Footer ============ */
.rg-footer {
    padding: .9rem 1.5rem;
    border-top: 1px solid var(--rg-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: .76rem;
    color: var(--rg-muted);
    background: #fff;
}
.rg-footer a { color: var(--rg-muted); text-decoration: none; }
.rg-footer a:hover { color: var(--rg-primary); }

/* ============ Charts ============ */
.rg-chart { position: relative; width: 100%; }
.rg-chart.apexcharts-canvas { margin: 0 auto; }

/* Print */
@media print {
    .rg-sidebar, .rg-navbar, .rg-footer, .rg-filterbar, .no-print { display: none !important; }
    .rg-main { margin-left: 0 !important; }
    .rg-card { box-shadow: none; border-color: #cbd5e1; }
    body.rg-body { background: #fff; }
}

/* ============ Badge tones ============ */
.rg-badge.badge-success { background: var(--rg-success-bg); color: var(--rg-success); }
.rg-badge.badge-primary { background: var(--rg-primary-50); color: var(--rg-primary-600); }
.rg-badge.badge-danger { background: var(--rg-danger-bg); color: var(--rg-danger); }
.rg-badge.badge-warning { background: var(--rg-warning-bg); color: var(--rg-warning); }
.rg-badge.badge-info { background: var(--rg-info-bg); color: var(--rg-info); }
.rg-badge.badge-secondary { background: var(--rg-secondary-bg); color: var(--rg-secondary); }
.rg-badge.badge-dark { background: #e2e8f0; color: #334155; }
/* ============================================
   STAT CARDS - EXACT STYLING AS IMAGE
   ============================================ */

/* Card Container */
.rg-stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 22px 24px 20px;
    border: 1px solid #eef2f6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    height: 100%;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.rg-stat-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border-color: #e2e8f0;
}

/* Label - "Total Rides" etc */
.rg-stat-label {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
    display: block;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* Value - Big number */
.rg-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #0a1628;
    line-height: 1.2;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
    display: block;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* Delta - Small text below */
.rg-stat-delta {
    font-size: 13px;
    color: #64748b;
    display: block;
    font-family: 'Inter', -apple-system, sans-serif;
    padding-top: 2px;
}

/* Delta Colors */
.rg-stat-delta.up { 
    color: #059669; 
}

.rg-stat-delta.down { 
    color: #dc2626; 
}

.rg-stat-delta.flat { 
    color: #6b7280; 
}

/* Arrow icons before text */
.rg-stat-delta.up::before {
    content: '↑';
    display: inline-block;
    margin-right: 4px;
    font-weight: 600;
}

.rg-stat-delta.down::before {
    content: '↓';
    display: inline-block;
    margin-right: 4px;
    font-weight: 600;
}

/* Time emoji or icon style (⏱️) - optional if you want to add it */
.rg-stat-delta .time-icon {
    margin-right: 4px;
}

/* ============================================
   RESPONSIVE FIXES
   ============================================ */

/* 4 cards per row on large screens */
@media (min-width: 1200px) {
    .col-xl-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* 2 cards per row on tablets */
@media (max-width: 1199px) and (min-width: 576px) {
    .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* 1 card per row on mobile */
@media (max-width: 575px) {
    .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Ensure proper spacing */
.row.g-3 {
    margin-left: -12px;
    margin-right: -12px;
}

.row.g-3 > [class*="col-"] {
    padding-left: 12px;
    padding-right: 12px;
}

/* ============================================
   FORCE VISIBILITY - FIX FOR HIDDEN CARDS
   ============================================ */

.rg-stat-card,
.rg-stat-label,
.rg-stat-value,
.rg-stat-delta {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Remove any hidden classes */
.rg-stat-card .hidden,
.rg-stat-card .d-none {
    display: block !important;
}

/* ============================================
   OPTIONAL - TONE COLORS FOR ICONS (if needed)
   ============================================ */

.rg-stat-card .tone-primary { color: #4f46e5; }
.rg-stat-card .tone-info { color: #0ea5e9; }
.rg-stat-card .tone-success { color: #059669; }
.rg-stat-card .tone-dark { color: #1e293b; }
.rg-stat-card .tone-warning { color: #d97706; }
/* Prevent text from wrapping/cutting */
.rg-stat-value {
    white-space: nowrap;
    overflow: visible !important;
    text-overflow: clip !important;
}

.rg-stat-delta {
    white-space: nowrap;
    overflow: visible !important;
    text-overflow: clip !important;
}