/* =====================================================================
   Race Trading EMS — v2 Theme
   Inspired by reference login.html + app.html designs.
   Brand: Navy #213094  •  Red #dc2626
   ===================================================================== */

:root {
    /* Brand */
    --primary-navy:        #213094;
    --primary-navy-hover:  #1a2775;
    --primary-navy-light:  rgba(33, 48, 148, 0.1);
    --primary-red:         #dc2626;
    --primary-red-hover:   #b91c1c;
    --primary-red-light:   rgba(220, 38, 38, 0.1);

    /* Neutral */
    --bg-layout:   #eef2fb;
    --bg-card:     #ffffff;
    --text-dark:   #1e293b;
    --text-muted:  #64748b;
    --border:      #e2e8f0;
    --border-soft: #f1f5f9;

    /* Login gradients */
    --gradient-start: #fde8e8;
    --gradient-end:   #e0e6f6;

    /* Semantic */
    --accent-green:  #10b981;
    --accent-orange: #f59e0b;
    --accent-blue:   #3b82f6;

    /* Layout */
    --sidebar-w:            260px;
    --sidebar-w-collapsed:  85px;
}

/* ---------------------------------------------------------------------
   RESET / BASE
   --------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
/* Apply Poppins only to real elements, NOT pseudo-elements (FA uses ::before for icons) */
* {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
html, body { height: 100%; }
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-layout);
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-navy); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-red); }
h1,h2,h3,h4,h5,h6 { color: var(--text-dark); font-weight: 600; }
img { max-width: 100%; display: block; }

.text-brand-red  { color: var(--primary-red)  !important; }
.text-brand-navy { color: var(--primary-navy) !important; }
.text-muted      { color: var(--text-muted)   !important; }
.fw-semibold     { font-weight: 600 !important; }
.fw-bold         { font-weight: 700 !important; }

/* ---------------------------------------------------------------------
   APP SHELL
   --------------------------------------------------------------------- */
.rt-app {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* ---------------------------------------------------------------------
   SIDEBAR (navy, rounded right, sliding pill indicator)
   --------------------------------------------------------------------- */
.rt-sidebar {
    width: var(--sidebar-w);
    background-color: var(--primary-navy);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.75rem 0 1.5rem;
    border-top-right-radius: 40px;
    border-bottom-right-radius: 40px;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 10;
    transition: width .4s cubic-bezier(.25,1,.5,1), transform .3s ease;
}

/* Header inside sidebar */
.rt-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem 0 1.75rem;
    margin-bottom: 2.75rem;
}
.rt-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    white-space: nowrap;
    transition: opacity .3s;
}
.rt-logo-mark {
    width: 40px; height: 40px;
    background: var(--primary-red);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 19px;
    box-shadow: 0 6px 14px rgba(220,38,38,.4);
    flex-shrink: 0;
    font-style: italic;
}
.rt-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.rt-brand-text strong { font-size: 14px; letter-spacing: .5px; font-weight: 700; }
.rt-brand-text small  { color: rgba(255,255,255,.55); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px; }

.rt-toggle-sidebar {
    background: rgba(255,255,255,.1);
    border: 0;
    color: #fff;
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .3s;
}
.rt-toggle-sidebar:hover { background: rgba(255,255,255,.2); transform: scale(1.05); }
.rt-toggle-sidebar i { font-size: 16px; }


/* Menu list */
.rt-sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    position: relative;
}

.rt-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 14px 2.25rem;
    margin-left: 1.5rem;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    z-index: 2;
    white-space: nowrap;
    transition: color .35s, padding .35s, margin .35s;
}
.rt-nav-link-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.rt-nav-link i {
    width: 22px;
    font-size: 1.05rem;
    text-align: center;
}
.rt-nav-link:hover { color: #fff; }
.rt-nav-link.active {
    color: var(--primary-navy);
    font-weight: 600;
}
.rt-nav-badge {
    background: rgba(255,255,255,.15);
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: .7rem;
    font-weight: 600;
    transition: all .35s;
}
.rt-nav-link.active .rt-nav-badge {
    background: var(--primary-red-light);
    color: var(--primary-red);
}


/* THE SLIDING INDICATOR PILL */
.rt-active-indicator {
    position: absolute;
    left: 1.5rem;
    right: 0;
    background-color: var(--bg-layout);
    border-radius: 30px 0 0 30px;
    z-index: 1;
    pointer-events: none;
    transition: top .38s cubic-bezier(.34,1.35,.64,1),
                height .38s cubic-bezier(.34,1.35,.64,1),
                left .4s cubic-bezier(.25,1,.5,1);
}
.rt-active-indicator::before {
    content:'';
    position: absolute;
    top: -24px; right: 0;
    width: 24px; height: 24px;
    background: transparent;
    border-bottom-right-radius: 24px;
    box-shadow: 10px 10px 0 10px var(--bg-layout);
}
.rt-active-indicator::after {
    content:'';
    position: absolute;
    bottom: -24px; right: 0;
    width: 24px; height: 24px;
    background: transparent;
    border-top-right-radius: 24px;
    box-shadow: 10px -10px 0 10px var(--bg-layout);
}

/* Sidebar footer decoration */
.rt-sidebar-illustration {
    padding: 0 2rem;
    text-align: center;
    color: rgba(255,255,255,.4);
    font-size: 11px;
    transition: opacity .3s, transform .3s;
}
.rt-sidebar-illustration svg { width: 110px; height: auto; margin-bottom: 10px; opacity: .85; }

/* Sidebar scroll */
.rt-sidebar-body { flex: 1; overflow-y: auto; padding: 0 0 1rem; }
.rt-sidebar-body::-webkit-scrollbar { width: 4px; }
.rt-sidebar-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

/* ---------------------------------------------------------------------
   MAIN AREA
   --------------------------------------------------------------------- */
.rt-main {
    flex-grow: 1;
    padding: 1.5rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

/* ---------------------------------------------------------------------
   TOP BAR (white pill)
   --------------------------------------------------------------------- */
.rt-topbar {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(33,48,148,.04);
    flex-shrink: 0;
    gap: 16px;
}
.rt-topbar-title-wrap { min-width: 0; }
.rt-topbar-title { font-size: 1.25rem; font-weight: 600; color: var(--text-dark); margin: 0; line-height: 1.2; }
.rt-topbar-sub { font-size: 11.5px; color: var(--text-muted); margin: 2px 0 0; }

.rt-topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.rt-topbar-search {
    position: relative;
    display: flex;
    align-items: center;
}
.rt-topbar-search input {
    background: var(--bg-layout);
    border: 0;
    padding: 10px 20px 10px 42px;
    border-radius: 14px;
    font-family: inherit;
    font-size: .82rem;
    color: var(--text-dark);
    outline: none;
    width: 240px;
    transition: all .3s;
}
.rt-topbar-search input::placeholder { color: #94a3b8; }
.rt-topbar-search input:focus {
    width: 280px;
    box-shadow: 0 0 0 2px var(--primary-navy-light);
}
.rt-topbar-search i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: .95rem;
}

.rt-icon-btn {
    background: var(--primary-navy-light);
    color: var(--primary-navy);
    border: 0;
    width: 42px; height: 42px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .3s;
    position: relative;
}
.rt-icon-btn i { font-size: 1.05rem; }
.rt-icon-btn:hover { background: var(--primary-navy); color: #fff; }
.rt-icon-btn.rt-icon-danger:hover { background: var(--primary-red); }
.rt-icon-btn .rt-dot {
    position: absolute;
    top: 9px; right: 9px;
    width: 8px; height: 8px;
    background: var(--primary-red);
    border-radius: 50%;
    border: 2px solid #fff;
}

.rt-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 4px;
    border-radius: 100px;
    background: var(--bg-layout);
    cursor: pointer;
    transition: all .3s;
    border: 0;
    font-family: inherit;
}
.rt-user-chip:hover { background: var(--primary-navy-light); }
.rt-user-chip .rt-avatar { width: 34px; height: 34px; font-size: 11px; }
.rt-user-chip-name { font-size: 12.5px; font-weight: 600; color: var(--text-dark); line-height: 1.1; }
.rt-user-chip-role { font-size: 10.5px; color: var(--text-muted); line-height: 1.1; margin-top: 2px; }

.rt-menu-toggle { display: none; }

/* ---------------------------------------------------------------------
   PAGE HEAD
   --------------------------------------------------------------------- */
.rt-content { display: flex; flex-direction: column; gap: 1.25rem; }

.rt-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 4px 4px 0;
}
.rt-page-head h1 { font-size: 1.35rem; font-weight: 600; margin: 0 0 4px; color: var(--text-dark); }
.rt-page-head p { color: var(--text-muted); font-size: .82rem; margin: 0; }

/* ---------------------------------------------------------------------
   AVATARS
   --------------------------------------------------------------------- */
.rt-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary-navy);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px; flex-shrink: 0;
    text-transform: uppercase; letter-spacing: .5px;
}
.rt-avatar.rt-av-lg { width: 56px; height: 56px; font-size: 18px; border-radius: 20px; }
.rt-avatar.rt-av-xl { width: 100px; height: 100px; font-size: 32px; border-radius: 30px; }
.rt-avatar.rt-av-red { background: var(--primary-red); }
.rt-avatar.rt-av-gold { background: #C9A86A; }

/* ---------------------------------------------------------------------
   CARDS
   --------------------------------------------------------------------- */
.rt-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 10px 30px rgba(33,48,148,.03);
    border: 1px solid rgba(255,255,255,.5);
    overflow: clip;
}
.rt-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1.2rem;
}
.rt-card-head h5 { font-size: 1rem; font-weight: 600; margin: 0; color: var(--text-dark); }
.rt-card-body { padding: 0; }
.rt-card.p-0 .rt-card-body { padding: 0; }
.rt-card .rt-card-body.p-0 { padding: 0; }

/* Stat cards */
.rt-stat {
    background: var(--bg-card);
    border-radius: 22px;
    padding: 1.25rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 30px rgba(33,48,148,.03);
    border: 1px solid rgba(255,255,255,.5);
    transition: transform .3s;
}
.rt-stat:hover { transform: translateY(-3px); }
.rt-stat-icon {
    width: 52px; height: 52px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.rt-stat-icon.rt-red   { background: var(--primary-red-light);   color: var(--primary-red); }
.rt-stat-icon.rt-navy  { background: var(--primary-navy-light);  color: var(--primary-navy); }
.rt-stat-icon.rt-green { background: rgba(16,185,129,.12);       color: var(--accent-green); }
.rt-stat-icon.rt-amber { background: rgba(245,158,11,.12);       color: var(--accent-orange); }
.rt-stat-icon.rt-gold  { background: rgba(201,168,106,.15);      color: #A88A4E; }
.rt-stat-icon.rt-blue  { background: rgba(59,130,246,.1);        color: var(--accent-blue); }

.rt-stat-label { font-size: .72rem; color: var(--text-muted); font-weight: 500; letter-spacing: .4px; text-transform: uppercase; margin-bottom: 2px; }
.rt-stat-value { font-size: 1.55rem; font-weight: 700; color: var(--text-dark); line-height: 1.1; }
.rt-stat-delta { font-size: .72rem; margin-top: 4px; display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.rt-stat-delta.up   { color: var(--accent-green); }
.rt-stat-delta.down { color: var(--primary-red); }

/* ---------------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------------- */
.btn, button.btn {
    padding: 11px 22px;
    border: 0;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: .82rem;
    cursor: pointer;
    transition: all .3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}
.btn i { font-size: 1rem; }
.btn:focus, .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-navy-light); }

.btn-primary {
    background: var(--primary-red);
    color: #fff;
    box-shadow: 0 4px 15px rgba(220,38,38,.2);
}
.btn-primary:hover {
    background: var(--primary-red-hover);
    color: #fff;
    box-shadow: 0 8px 22px rgba(220,38,38,.35);
    transform: translateY(-1px);
}
.btn-navy {
    background: var(--primary-navy);
    color: #fff;
}
.btn-navy:hover { background: var(--primary-navy-hover); color: #fff; }
.btn-outline-primary {
    background: transparent;
    color: var(--primary-red);
    border: 1.5px solid var(--primary-red);
}
.btn-outline-primary:hover { background: var(--primary-red); color: #fff; }
.btn-light-soft {
    background: var(--bg-layout);
    color: var(--text-dark);
}
.btn-light-soft:hover { background: var(--primary-navy-light); color: var(--primary-navy); }
.btn-light-soft.active { background: var(--primary-navy); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: .74rem; }
.btn-group .btn { border-radius: 10px; }
.btn-group > .btn:not(:first-child) { margin-left: 4px; }

/* ---------------------------------------------------------------------
   BADGES
   --------------------------------------------------------------------- */
.rt-badge {
    font-size: .7rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
    letter-spacing: .3px;
    display: inline-block;
    white-space: nowrap;
}
.rt-badge-success   { background: rgba(16,185,129,.12);  color: var(--accent-green); }
.rt-badge-danger    { background: var(--primary-red-light);color: var(--primary-red); }
.rt-badge-warning   { background: rgba(245,158,11,.12);  color: var(--accent-orange); }
.rt-badge-info      { background: rgba(59,130,246,.1);   color: var(--accent-blue); }
.rt-badge-primary   { background: var(--primary-navy-light); color: var(--primary-navy); }
.rt-badge-secondary { background: #f1f5f9; color: #64748b; }
.rt-badge-light     { background: #f1f5f9; color: #94a3b8; }

/* ---------------------------------------------------------------------
   TABLES
   --------------------------------------------------------------------- */
.rt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.rt-table thead th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--bg-layout);
    background: transparent;
    white-space: nowrap;
}
.rt-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--bg-layout);
    color: var(--text-dark);
    vertical-align: middle;
}
.rt-table tbody tr:last-child td { border-bottom: 0; }
.rt-table tbody tr { transition: background .2s; }
.rt-table tbody tr:hover { background: var(--bg-layout); }
.rt-table-wrap { overflow-x: auto; margin: 0 -1.75rem -1.5rem; padding: 0 1.75rem 1rem; }

.rt-cell-user { display: flex; align-items: center; gap: 12px; }
.rt-cell-user .rt-avatar { width: 36px; height: 36px; font-size: 11px; }
.rt-cell-user-name { font-weight: 600; color: var(--text-dark); font-size: .85rem; line-height: 1.1; }
.rt-cell-user-sub  { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

/* ---------------------------------------------------------------------
   FORMS
   --------------------------------------------------------------------- */
.rt-form-label {
    font-size: .72rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    display: block;
}
.form-control, .form-select {
    width: 100%;
    padding: 11px 15px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: .85rem;
    color: var(--text-dark);
    outline: none;
    background: #fff;
    transition: border-color .3s, box-shadow .3s;
    height: auto;
    line-height: 1.5;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-navy);
    box-shadow: 0 0 0 3px var(--primary-navy-light);
}
textarea.form-control { resize: vertical; min-height: 100px; }

.rt-input-group {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    transition: border-color .3s;
}
.rt-input-group:focus-within { border-color: var(--primary-navy); box-shadow: 0 0 0 3px var(--primary-navy-light); }
.rt-input-group i { padding: 0 14px; color: var(--text-muted); font-size: 1rem; }
.rt-input-group input {
    flex: 1;
    border: 0;
    outline: none;
    padding: 11px 14px 11px 0;
    font-family: inherit;
    font-size: .85rem;
    background: transparent;
}

.form-check-input { accent-color: var(--primary-navy); }

/* ---------------------------------------------------------------------
   LOGIN PAGE (split card with wave + floating avatars)
   --------------------------------------------------------------------- */
.rt-login {
    min-height: 100vh;
    background: var(--bg-layout);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    padding: 20px;
}
.rt-login-bg { position: absolute; inset: 0; overflow: hidden; z-index: 1; pointer-events: none; }
.rt-login-blob {
    position: absolute;
    border-radius: 50%;
    opacity: .12;
    filter: blur(80px);
}
.rt-login-blob.blob-1 {
    width: 500px; height: 500px;
    top: -100px; right: -100px;
    background: var(--primary-red);
}
.rt-login-blob.blob-2 {
    width: 450px; height: 450px;
    bottom: -100px; left: -100px;
    background: var(--primary-navy);
}

.rt-login-card {
    width: 100%;
    max-width: 940px;
    height: 580px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(33,48,148,.08);
    display: flex;
    overflow: hidden;
    z-index: 10;
    position: relative;
    opacity: 0;                       /* GSAP will animate in */
    transform: scale(.96);
}

.rt-login-hero {
    flex: 1.1;
    background: #f8fafc;
    padding: 2.25rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.rt-login-wave {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 52%;
    z-index: 1;
}
.rt-login-hero-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.rt-login-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
}
.rt-login-logo-img {
    height: 52px;
    width: auto;
    object-fit: contain;
}

/* Mobile top banner (shown when hero is hidden < 992px) */
.rt-login-mobile-top {
    display: none;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #fde8e8, #e0e6f6);
    margin: -3rem -3rem 2rem;
    padding: 2rem;
    border-radius: 0;
}
.rt-login-mobile-top img {
    height: 46px;
    width: auto;
    object-fit: contain;
}

.rt-login-intro { text-align: center; padding: 0 1rem; margin-top: 3rem; }
.rt-login-intro h2 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: .7rem;
    font-weight: 700;
    line-height: 1.2;
}
.rt-login-intro h2 span { color: var(--primary-red); }
.rt-login-intro p {
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 320px;
    margin: 0 auto;
}

.rt-login-avatars {
    position: relative;
    height: 130px;
    margin: 1.5rem 0;
}
.rt-login-avatars .av {
    position: absolute;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 8px 20px rgba(33,48,148,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-family: inherit;
}
.rt-login-avatars .av.av-1 { width: 65px; height: 65px; left: 8%;  bottom: 5%;  background: linear-gradient(135deg, #213094, #1a2775); font-size: 18px; }
.rt-login-avatars .av.av-2 { width: 50px; height: 50px; left: 32%; top: 0%;    background: linear-gradient(135deg, #dc2626, #b91c1c); font-size: 15px; }
.rt-login-avatars .av.av-3 { width: 45px; height: 45px; left: 55%; bottom: 8%; background: linear-gradient(135deg, #C9A86A, #A88A4E); font-size: 14px; }
.rt-login-avatars .av.av-4 { width: 60px; height: 60px; right: 8%; top: 8%;    background: linear-gradient(135deg, #213094, #dc2626); font-size: 17px; }

.rt-login-dots { display: flex; justify-content: center; gap: 6px; }
.rt-login-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: all .3s;
}
.rt-login-dots span.active { width: 18px; border-radius: 10px; background: var(--primary-navy); }

/* Right sign-in form panel */
.rt-login-form {
    flex: 1;
    padding: 3rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
    overflow-y: auto;
}
.rt-login-form h3 {
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: .35rem;
    font-weight: 600;
}
.rt-login-form > .lead {
    font-size: .82rem;
    color: var(--text-muted);
    margin: 0 0 2rem;
}

.rt-login-field {
    margin-bottom: 1.5rem;
    position: relative;
}
.rt-login-field label {
    display: block;
    font-size: .7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.rt-login-field-input {
    position: relative;
    display: flex;
    align-items: center;
}
.rt-field-icon-left {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: .95rem;
    transition: color .3s;
    pointer-events: none;
    z-index: 1;
}
.rt-login-field-input input {
    width: 100%;
    border: 0;
    border-bottom: 1.5px solid var(--border);
    padding: 10px 36px 10px 34px;
    font-family: inherit;
    font-size: .95rem;
    color: var(--text-dark);
    outline: none;
    background: transparent;
    transition: border-color .3s;
}
.rt-login-field-input input:focus { border-color: var(--primary-navy); }
.rt-login-field-input input:focus + .rt-field-icon-left,
.rt-login-field-input input:focus ~ .rt-field-icon-left { color: var(--primary-navy); }
.rt-login-field-input input:focus ~ .toggle-password { color: var(--primary-navy); }
.toggle-password {
    position: absolute;
    right: 4px;
    color: var(--text-muted);
    font-size: .95rem;
    cursor: pointer;
    transition: color .3s;
    padding: 4px;
}

.rt-login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: .78rem;
}
.rt-login-remember { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-muted); }
.rt-login-remember input { accent-color: var(--primary-navy); cursor: pointer; }
.rt-login-forgot {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 500;
    transition: opacity .3s;
}
.rt-login-forgot:hover { opacity: .75; }

.rt-login-submit {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-red-hover));
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(220,38,38,.2);
    transition: all .3s;
}
.rt-login-submit:hover {
    box-shadow: 0 8px 22px rgba(220,38,38,.35);
    transform: translateY(-1px);
}

.rt-login-demo {
    background: var(--primary-navy-light);
    border-radius: 12px;
    padding: 10px 14px;
    margin-top: 1.5rem;
    font-size: .72rem;
    color: var(--primary-navy);
    line-height: 1.6;
}
.rt-login-demo code {
    background: rgba(255,255,255,.7);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: .68rem;
    color: var(--primary-navy-hover);
    font-family: 'Courier New', monospace;
}

.rt-login-foot {
    margin-top: 1.5rem;
    text-align: center;
    font-size: .7rem;
    color: var(--text-muted);
}

.rt-alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: .8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}
.rt-alert i { font-size: 1rem; }
.rt-alert-danger { background: rgba(220,38,38,.08); color: var(--primary-red); border: 1px solid rgba(220,38,38,.2); }
.rt-alert-success { background: rgba(16,185,129,.08); color: var(--accent-green); border: 1px solid rgba(16,185,129,.2); }
.rt-alert-info { background: rgba(59,130,246,.08); color: var(--accent-blue); border: 1px solid rgba(59,130,246,.2); }

/* ---------------------------------------------------------------------
   CHECK-IN CARD (Employee dashboard)
   --------------------------------------------------------------------- */
.rt-checkin-card {
    background: var(--primary-navy);
    color: #fff;
    border-radius: 24px;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    height: 100%;
}
.rt-checkin-card::before {
    content:'';
    position: absolute;
    right: -80px; top: -80px;
    width: 240px; height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220,38,38,.35) 0%, transparent 70%);
    pointer-events: none;
}
.rt-checkin-card > * { position: relative; z-index: 1; }
.rt-checkin-greet { font-size: .78rem; color: rgba(255,255,255,.7); }
.rt-checkin-name { font-size: 1.25rem; color: #fff; font-weight: 600; margin: 2px 0 18px; }
.rt-checkin-clock {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.rt-checkin-date { color: rgba(255,255,255,.7); font-size: .82rem; margin: 4px 0 18px; }
.rt-checkin-btn {
    background: var(--primary-red);
    color: #fff;
    border: 0;
    padding: 13px 24px;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(220,38,38,.35);
    transition: all .3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.rt-checkin-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(220,38,38,.45); }
.rt-checkin-btn.checked-out { background: #fff; color: var(--primary-navy); box-shadow: 0 8px 20px rgba(0,0,0,.15); }

.rt-checkin-info {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.15);
}
.rt-checkin-info div small { color: rgba(255,255,255,.55); font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; }
.rt-checkin-info div strong { color: #fff; font-size: .95rem; display: block; margin-top: 2px; font-weight: 600; }

/* ---------------------------------------------------------------------
   CALENDAR
   --------------------------------------------------------------------- */
.rt-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.rt-calendar .dow { font-size: .68rem; font-weight: 600; color: var(--text-muted); text-align: center; padding: 6px 0; letter-spacing: .5px; text-transform: uppercase; }
.rt-calendar .day {
    aspect-ratio: 1/1;
    border-radius: 10px;
    background: var(--bg-layout);
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 600;
    position: relative;
    color: var(--text-dark);
    transition: transform .2s;
}
.rt-calendar .day:not(.empty):hover { transform: scale(1.05); }
.rt-calendar .day.empty { background: transparent; }
.rt-calendar .day.today { outline: 2px solid var(--primary-navy); outline-offset: 1px; }
.rt-calendar .day.present { background: rgba(16,185,129,.18); color: var(--accent-green); }
.rt-calendar .day.absent  { background: rgba(220,38,38,.12);  color: var(--primary-red); }
.rt-calendar .day.late    { background: rgba(245,158,11,.18); color: var(--accent-orange); }
.rt-calendar .day.leave   { background: var(--primary-navy-light); color: var(--primary-navy); }
.rt-calendar .day.weekoff { background: #f1f5f9; color: #94a3b8; }

.rt-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .72rem; color: var(--text-muted); margin-top: 14px; }
.rt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rt-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------------------------------------------------------------------
   BOOTSTRAP OVERRIDES
   --------------------------------------------------------------------- */
.dropdown-menu {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(33,48,148,.12);
    padding: 6px;
    font-size: .82rem;
    font-family: inherit;
    margin-top: 8px !important;
}
.dropdown-item { border-radius: 10px; padding: 9px 12px; color: var(--text-dark); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--bg-layout); color: var(--primary-navy); }
.dropdown-item i { margin-right: 8px; width: 16px; text-align: center; color: var(--text-muted); }
.dropdown-item.text-danger:hover { background: rgba(220,38,38,.08); color: var(--primary-red); }
.dropdown-item.text-danger:hover i { color: var(--primary-red); }
.dropdown-divider { margin: 4px 6px; }

.modal-content { border: 0; border-radius: 24px; box-shadow: 0 25px 60px rgba(33,48,148,.15); font-family: inherit; overflow: hidden; }
.modal-header { border-bottom: 1px solid var(--bg-layout); padding: 20px 24px; }
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid var(--bg-layout); padding: 14px 24px; gap: 8px; }
.btn-close {
    background: var(--bg-layout) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23213094'%3E%3Cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3E%3C/svg%3E") center/10px no-repeat;
    border-radius: 10px;
    padding: 8px;
    opacity: 1;
    width: 32px; height: 32px;
    border: 0;
}
.btn-close:hover { background-color: var(--primary-navy-light); }

.nav-pills { display: flex; gap: 6px; }
.nav-pills .nav-link {
    color: var(--text-muted);
    border-radius: 10px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 500;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.nav-pills .nav-link:hover { background: var(--bg-layout); color: var(--primary-navy); }
.nav-pills .nav-link.active { background: var(--primary-navy); color: #fff; }

.list-group-item {
    border: 0;
    padding: 12px 16px;
    border-radius: 12px !important;
    font-size: .85rem;
    color: var(--text-dark);
    font-family: inherit;
    background: transparent;
    cursor: pointer;
    transition: background .2s;
}
.list-group-item.active { background: var(--primary-navy); color: #fff; }
.list-group-item.active i { color: #fff !important; }
.list-group-item:hover:not(.active) { background: var(--bg-layout); }
.list-group-flush { display: flex; flex-direction: column; gap: 4px; }

.progress { background: var(--bg-layout); border-radius: 10px; height: 8px; overflow: hidden; }
.progress-bar { background: linear-gradient(90deg, var(--primary-navy), var(--primary-red)); }

.pagination .page-link {
    color: var(--text-muted);
    border: 0;
    background: transparent;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: .8rem;
    font-family: inherit;
    margin: 0 2px;
}
.pagination .page-item.active .page-link { background: var(--primary-navy); color: #fff; }
.pagination .page-item.disabled .page-link { opacity: .4; }

.form-check-input:checked { background-color: var(--primary-navy); border-color: var(--primary-navy); }
.form-switch .form-check-input:focus { box-shadow: 0 0 0 3px var(--primary-navy-light); }

/* Charts */
.rt-chart-wrap { position: relative; height: 280px; }

/* Utility spacing */
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2rem; }
.p-0 { padding: 0 !important; }
.h-100 { height: 100%; }
.text-end { text-align: right; }
.text-center { text-align: center; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-none { display: none; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.justify-content-center { justify-content: center; }
.flex-grow-1 { flex-grow: 1; }
.min-w-0 { min-width: 0; }
.w-100 { width: 100%; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* Bootstrap responsive helpers keep working */
@media (min-width: 768px) {
    .d-md-block { display: block; }
    .d-md-inline { display: inline; }
    .d-md-none { display: none; }
}
@media (min-width: 992px) {
    .d-lg-block { display: block; }
    .d-lg-none { display: none; }
}

/* ---------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .rt-sidebar {
        position: fixed;
        top: 0; left: 0;
        transform: translateX(-100%);
        height: 100vh;
        border-radius: 0 40px 40px 0;
        z-index: 1030;
    }
    .rt-sidebar.open { transform: translateX(0); }
    .rt-main { padding: 1.2rem; height: auto; min-height: 100vh; }
    .rt-menu-toggle {
        display: inline-flex;
        background: var(--primary-navy-light);
        color: var(--primary-navy);
        width: 40px; height: 40px;
        border: 0;
        border-radius: 12px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    .rt-topbar-search input { width: 160px; }
    .rt-topbar-search input:focus { width: 200px; }
    .rt-user-chip-info { display: none; }
    .rt-login-hero { display: none; }
    .rt-login-form { padding: 3rem 2.5rem; flex: 1 1 100%; }
    .rt-login-card { height: auto; min-height: 480px; max-width: 440px; }
    .rt-login-mobile-top { display: flex; margin: -3rem -2.5rem 2rem; }
}

.rt-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(33,48,148,.4);
    z-index: 1020;
}
.rt-backdrop.show { display: block; }

@media (max-width: 575.98px) {
    .rt-main { padding: 1rem; gap: 1rem; }
    .rt-card { padding: 1.25rem; border-radius: 20px; }
    .rt-topbar { padding: 12px 16px; }
    .rt-topbar-title { font-size: 1rem; }
    .rt-topbar-search { display: none; }
    .rt-checkin-clock { font-size: 1.9rem; }
    .rt-stat-value { font-size: 1.25rem; }
    .rt-stat { padding: 1rem; }
    .rt-stat-icon { width: 44px; height: 44px; font-size: 1.15rem; }

    /* Login mobile (phone) */
    .rt-login { padding: 16px; }
    .rt-login-card { max-width: 100%; border-radius: 20px; }
    .rt-login-form { padding: 3rem 1.5rem; }
    .rt-login-form h3 { font-size: 1.35rem; }
    .rt-login-mobile-top { margin: -3rem -1.5rem 2rem; }
    .rt-login-mobile-top img { height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
