:root {
    --rm-black: #030303;
    --rm-red: #dc1f26;
    --rm-red-deep: #b4181e;
    --rm-red-soft: rgba(220, 31, 38, 0.16);
    --rm-ink: #030303;
    --rm-navy: #030303;
    --rm-deep: #141414;
    --rm-panel: #1a1a1a;
    --rm-line: rgba(255, 255, 255, 0.1);
    --rm-text: #f5f5f5;
    --rm-muted: #9a9a9a;
    --rm-accent: #dc1f26;
    --rm-accent-soft: rgba(220, 31, 38, 0.16);
    --rm-danger: #dc1f26;
    --rm-font-display: "Space Grotesk", sans-serif;
    --rm-font-body: "Manrope", sans-serif;
}

/* =========================================================
   LOGIN — BLACK + RED BRAND SHELL
   ========================================================= */
.auth-shell {
    margin: 0;
    min-height: 100vh;
    font-family: var(--rm-font-body);
    background: var(--rm-black);
    color: #fff;
}

.auth-stage {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 4vw, 3rem);
    overflow: hidden;
}

.auth-stage__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 500px at 85% 15%, rgba(220, 31, 38, 0.28), transparent 60%),
        radial-gradient(700px 420px at 10% 90%, rgba(220, 31, 38, 0.12), transparent 55%),
        linear-gradient(145deg, #030303 0%, #0d0d0d 45%, #151515 100%);
}

.auth-stage__flare {
    position: absolute;
    width: 520px;
    height: 520px;
    top: -180px;
    right: -80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220, 31, 38, 0.35), transparent 68%);
    animation: authFloat 11s ease-in-out infinite;
}

.auth-stage__beam {
    position: absolute;
    left: -10%;
    bottom: 18%;
    width: 70%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(220, 31, 38, 0.55), transparent);
    transform: rotate(-8deg);
    opacity: 0.7;
}

.auth-stage__grain {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

.auth-top,
.auth-main,
.auth-bottom {
    position: relative;
    z-index: 1;
}

.auth-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
}

.auth-hero__kicker {
    margin: 0 0 1rem;
    color: var(--rm-red);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.auth-hero__brand {
    margin: 0 0 1.25rem;
    font-family: var(--rm-font-display);
    font-size: clamp(3rem, 7vw, 5.4rem);
    line-height: 0.92;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: #fff;
}

.auth-hero__brand span {
    color: var(--rm-red);
}

.auth-hero__copy {
    margin: 0;
    max-width: 28ch;
    color: #b5b5b5;
    font-size: 1.08rem;
    line-height: 1.55;
}

.auth-card {
    width: min(420px, 100%);
    justify-self: end;
    background: #fff;
    color: #111;
    border-radius: 1.15rem;
    padding: clamp(1.6rem, 3vw, 2.25rem);
    border-top: 4px solid var(--rm-red);
}

.auth-form__intro {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-form__logo {
    display: block;
    width: 120px;
    height: auto;
    margin: 0 auto 1.1rem;
    object-fit: contain;
}

.auth-form__title {
    margin: 0 0 0.35rem;
    font-family: var(--rm-font-display);
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #030303;
}

.auth-form__subtitle {
    margin: 0;
    color: #6b6b6b;
    font-size: 0.95rem;
    line-height: 1.45;
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-field__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-field__label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #4a4a4a;
}

.auth-field__input.form-control {
    height: 52px;
    border-radius: 0.75rem;
    border: 1px solid #ddd;
    background: #f7f7f7;
    color: #030303;
    font-size: 0.98rem;
    padding: 0.85rem 1rem;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.auth-field__input.form-control:focus {
    border-color: var(--rm-red);
    background: #fff;
    box-shadow: 0 0 0 3px var(--rm-red-soft);
}

.auth-field__error,
.auth-field__error span {
    color: var(--rm-red) !important;
    font-size: 0.85rem;
}

.auth-submit {
    width: 100%;
    margin-top: 0.65rem;
    height: 54px;
    border: 0;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--rm-red);
    color: #fff;
    font-family: var(--rm-font-display);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.auth-submit:hover {
    background: var(--rm-red-deep);
    transform: translateY(-1px);
    color: #fff;
}

.auth-bottom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: clamp(2rem, 6vh, 3.5rem);
    color: #7a7a7a;
    font-size: 0.8rem;
}

.auth-bottom__sep {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--rm-red);
}

@keyframes authFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(16px); }
}

@media (max-width: 991.98px) {
    .auth-main {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .auth-hero {
        text-align: center;
    }

    .auth-hero__copy {
        margin-left: auto;
        margin-right: auto;
    }

    .auth-hero__brand {
        font-size: clamp(2.6rem, 12vw, 3.6rem);
    }

    .auth-card {
        justify-self: stretch;
        width: 100%;
    }
}

/* =========================================================
   SIDEBAR — BLACK + RED BRAND SHELL
   ========================================================= */
#kt_app_sidebar.app-sidebar {
    background:
        radial-gradient(700px 360px at 0% 0%, rgba(220, 31, 38, 0.18), transparent 55%),
        linear-gradient(180deg, #030303 0%, #0f0f0f 55%, #161616 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

#kt_app_sidebar .app-sidebar-logo {
    position: relative;
    min-height: 80px;
    padding: 1.1rem 1.25rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(220, 31, 38, 0.1), transparent);
}

#kt_app_sidebar .app-sidebar-logo::after {
    content: "";
    position: absolute;
    left: 1.25rem;
    right: 1.25rem;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--rm-red), transparent 70%);
    opacity: 0.85;
}

#kt_app_sidebar .app-sidebar-logo-default {
    max-height: 42px;
    width: auto;
}

#kt_app_sidebar .app-sidebar-toggle {
    background: #1a1a1a !important;
    border: 1px solid rgba(220, 31, 38, 0.45) !important;
    color: var(--rm-red) !important;
    box-shadow: none !important;
}

#kt_app_sidebar .app-sidebar-toggle:hover {
    background: #222 !important;
    color: #fff !important;
}

#kt_app_sidebar .menu {
    font-family: var(--rm-font-body);
}

#kt_app_sidebar .menu-title {
    color: #d4d4d4 !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em;
}

#kt_app_sidebar .menu-icon,
#kt_app_sidebar .menu-icon .ki-duotone,
#kt_app_sidebar .menu-icon i {
    color: #8a8a8a !important;
}

#kt_app_sidebar .menu-link {
    border-radius: 0.75rem !important;
    margin-bottom: 2px;
    transition: background 0.18s ease, color 0.18s ease;
    position: relative;
}

#kt_app_sidebar .menu-link:hover {
    background: rgba(220, 31, 38, 0.1) !important;
}

#kt_app_sidebar .menu-link:hover .menu-title,
#kt_app_sidebar .menu-link:hover .menu-icon,
#kt_app_sidebar .menu-link:hover .menu-icon i,
#kt_app_sidebar .menu-link:hover .menu-icon .ki-duotone {
    color: #ffffff !important;
}

#kt_app_sidebar .menu-link.active,
#kt_app_sidebar .menu-item.here > .menu-link,
#kt_app_sidebar .menu-item.show > .menu-link {
    background: linear-gradient(90deg, rgba(220, 31, 38, 0.24), rgba(220, 31, 38, 0.05)) !important;
}

#kt_app_sidebar .menu-link.active::before,
#kt_app_sidebar .menu-item.here > .menu-link::before,
#kt_app_sidebar .menu-item.show > .menu-link:not(.menu-link-sub)::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--rm-red);
}

#kt_app_sidebar .menu-link.active .menu-title,
#kt_app_sidebar .menu-item.here > .menu-link .menu-title,
#kt_app_sidebar .menu-item.show > .menu-link .menu-title,
#kt_app_sidebar .menu-link.active .menu-icon,
#kt_app_sidebar .menu-link.active .menu-icon i,
#kt_app_sidebar .menu-link.active .menu-icon .ki-duotone {
    color: #ffffff !important;
}

#kt_app_sidebar .menu-sub .menu-link {
    padding-left: 0.85rem !important;
}

#kt_app_sidebar .menu-bullet .bullet {
    background-color: #666 !important;
}

#kt_app_sidebar .menu-link.active .menu-bullet .bullet,
#kt_app_sidebar .menu-link:hover .menu-bullet .bullet {
    background-color: var(--rm-red) !important;
}

#kt_app_sidebar .menu-arrow:after {
    color: #777 !important;
}

#kt_app_sidebar .scroll-y {
    scrollbar-width: thin;
    scrollbar-color: rgba(220, 31, 38, 0.4) transparent;
}

#kt_app_sidebar_menu_scroll {
    padding-top: 0.5rem !important;
}

#kt_app_sidebar .app-sidebar-footer,
#kt_app_sidebar_footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
}

.rm-sidebar-foot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rm-sidebar-foot__pulse {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--rm-red);
    box-shadow: 0 0 0 0 rgba(220, 31, 38, 0.45);
    animation: rmPulse 2.4s ease-out infinite;
}

.rm-sidebar-foot__title {
    font-family: var(--rm-font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: #f0f0f0;
    line-height: 1.1;
}

.rm-sidebar-foot__meta {
    font-size: 0.72rem;
    color: #8a8a8a;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@keyframes rmPulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 31, 38, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(220, 31, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 31, 38, 0); }
}

body[data-kt-app-sidebar-minimize="on"] .rm-sidebar-foot__title,
body[data-kt-app-sidebar-minimize="on"] .rm-sidebar-foot__meta {
    display: none;
}

/* =========================================================
   HEADER / NAVBAR — FUTURISTIC OPS BAR
   ========================================================= */
.app-header,
#kt_app_header {
    border-bottom: 1px solid rgba(3, 3, 3, 0.08) !important;
    background:
        linear-gradient(90deg, transparent 0%, rgba(220, 31, 38, 0.55) 35%, rgba(3, 3, 3, 0.35) 70%, transparent 100%) bottom / 100% 2px no-repeat,
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 250, 250, 0.92)) !important;
    backdrop-filter: blur(16px) saturate(1.2);
    box-shadow: 0 8px 28px rgba(3, 3, 3, 0.04);
}

#kt_app_header_container {
    min-height: 64px;
    max-width: 100%;
}

.rm-navbar {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-right: 0.75rem;
    max-width: 100%;
}

.rm-firm-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    max-width: 220px;
    padding: 0.45rem 0.85rem 0.45rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(3, 3, 3, 0.08);
    background: linear-gradient(135deg, #ffffff, #f4f4f4);
    box-shadow: 0 6px 16px rgba(3, 3, 3, 0.05);
}

.rm-firm-chip__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: var(--rm-red);
    box-shadow: 0 0 0 0 rgba(220, 31, 38, 0.45);
    animation: rmPulse 2.4s ease-out infinite;
}

.rm-firm-chip__label {
    font-family: var(--rm-font-display);
    font-size: 0.82rem;
    font-weight: 600;
    color: #141414;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rm-nav-btn {
    border-radius: 50% !important;
    border: 1px solid rgba(3, 3, 3, 0.08) !important;
    background: linear-gradient(145deg, #ffffff, #f3f3f3) !important;
    color: #2a2a2a !important;
    box-shadow: 0 6px 14px rgba(3, 3, 3, 0.05);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease !important;
}

.rm-nav-btn:hover,
.rm-nav-btn:focus {
    transform: translateY(-1px);
    border-color: rgba(220, 31, 38, 0.35) !important;
    color: var(--rm-red) !important;
    box-shadow: 0 10px 20px rgba(220, 31, 38, 0.12);
}

.rm-nav-pulse {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    animation: rmPulse 2s ease-out infinite;
}

.rm-avatar-ring {
    position: relative;
    padding: 2px;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #dc1f26, #030303 55%, #dc1f26);
    box-shadow: 0 8px 18px rgba(220, 31, 38, 0.18);
    transition: transform .18s ease, box-shadow .18s ease;
}

.rm-avatar-ring:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 12px 24px rgba(220, 31, 38, 0.24);
}

.rm-avatar-ring img,
#kt_header_user_menu_toggle > .symbol img {
    border-radius: 50% !important;
    object-fit: cover;
    width: 100%;
    height: 100%;
    display: block;
    background: #fff;
}

.rm-user-menu .symbol {
    width: 35px !important;
    height: 35px !important;
    flex: 0 0 35px;
}

.rm-user-menu .symbol img {
    border-radius: 50% !important;
    object-fit: cover;
    width: 35px !important;
    height: 35px !important;
    max-width: 35px !important;
    display: block;
    background: #fff;
}

.rm-avatar-ring.symbol-40px {
    width: 40px !important;
    height: 40px !important;
}

.rm-user-menu {
    border: 1px solid rgba(3, 3, 3, 0.08) !important;
    box-shadow: 0 18px 40px rgba(3, 3, 3, 0.12) !important;
    border-radius: 1rem !important;
    overflow: hidden;
}

/* =========================================================
   FOOTER — CLEAN OPS STRIP
   ========================================================= */
.rm-footer,
#kt_app_footer.rm-footer {
    /* Keep static so Metronic push-footer `left` does not create page overflow */
    position: static !important;
    left: auto !important;
    right: auto !important;
    width: 100%;
    max-width: 100%;
    margin-top: auto;
    height: auto !important;
    min-height: 60px;
    border-top: 1px solid rgba(3, 3, 3, 0.08);
    background:
        linear-gradient(90deg, transparent, rgba(220, 31, 38, 0.45), rgba(3, 3, 3, 0.2), transparent) top / 100% 2px no-repeat,
        linear-gradient(180deg, #fafafa 0%, #f3f3f3 100%);
    overflow: hidden;
}

.rm-footer__glow {
    display: none;
}

.rm-footer__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.rm-footer__mark {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--rm-red);
    box-shadow: 0 0 0 4px rgba(220, 31, 38, 0.12);
    flex: 0 0 auto;
}

.rm-footer__copy {
    font-size: 0.84rem;
    color: #5a5a5a;
    font-weight: 500;
}

.rm-footer__copy a {
    color: #141414;
    font-weight: 700;
    font-family: var(--rm-font-display);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.rm-footer__copy a:hover {
    color: var(--rm-red);
}

.rm-footer__meta {
    margin-top: 0.15rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a8a8a;
}

.rm-footer__links {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(3, 3, 3, 0.08);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 6px 16px rgba(3, 3, 3, 0.04);
    flex-wrap: wrap;
}

.rm-footer__links a {
    font-size: 0.8rem;
    font-weight: 600;
    color: #3a3a3a;
    text-decoration: none;
}

.rm-footer__links a:hover {
    color: var(--rm-red);
}

.rm-footer__sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #c4c4c4;
}

.rm-footer__version {
    font-family: var(--rm-font-display);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--rm-red);
    letter-spacing: 0.02em;
}

#kt_app_main {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

@media (max-width: 991.98px) {
    .rm-firm-chip {
        max-width: 140px;
        padding: 0.35rem 0.7rem;
    }

    .rm-navbar {
        margin-right: 0.25rem;
    }
}

body.app-default {
    font-family: var(--rm-font-body);
}

body.app-default h1,
body.app-default h2,
body.app-default h3,
body.app-default .page-heading {
    font-family: var(--rm-font-display);
    letter-spacing: -0.02em;
}
