* {
    box-sizing: border-box;
}

:root {
    --bg: #080a0f;
    --panel: #11141b;
    --panel-light: #171b24;
    --panel-dark: #0d1016;

    --border: #242a36;

    --text: #f4f6fa;
    --muted: #8992a3;

    --primary: #6a70ff;
    --primary-hover: #7c81ff;

    --green: #45d89a;
    --red: #ff6375;
    --yellow: #ffc857;

    --sidebar-width: 265px;

    --radius: 16px;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(
            circle at top right,
            rgba(106, 112, 255, 0.11),
            transparent 32%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
}

html[dir="rtl"] body {
    font-family:
        Tahoma,
        "Segoe UI",
        Arial,
        sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

/* Login */

.login-page {
    min-height: 100vh;
}

.login-layout {
    position: relative;

    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
}

.login-language {
    position: fixed;

    top: 20px;
    right: 24px;

    z-index: 50;
}

html[dir="rtl"] .login-language {
    right: auto;
    left: 24px;
}

.login-language a {
    min-width: 55px;
    height: 40px;

    padding: 0 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(17, 20, 27, 0.9);

    border: 1px solid var(--border);
    border-radius: 10px;

    color: #d5d9e1;

    font-size: 13px;
    font-weight: 700;
}

.login-card {
    width: 100%;
    max-width: 420px;

    padding: 36px;

    border: 1px solid var(--border);
    border-radius: 22px;

    background: rgba(17, 20, 27, 0.97);

    box-shadow:
        0 35px 100px rgba(0, 0, 0, 0.35);
}

.login-logo {
    width: 58px;
    height: 58px;

    margin-bottom: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            #777cff,
            #474de6
        );

    font-size: 22px;
    font-weight: 900;

    box-shadow:
        0 10px 35px rgba(
            106,
            112,
            255,
            0.28
        );
}

.login-card h1 {
    margin: 0;
    font-size: 29px;
}

.login-description {
    margin: 9px 0 27px;

    color: var(--muted);

    line-height: 1.8;
}

.login-error {
    margin-bottom: 20px;

    padding: 13px 15px;

    background: rgba(255, 99, 117, 0.09);

    border: 1px solid rgba(255, 99, 117, 0.25);
    border-radius: 10px;

    color: #ff909d;

    font-size: 13px;
}

.form-group {
    margin-bottom: 19px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    color: #bbc1cc;

    font-size: 13px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    height: 49px;

    padding: 0 14px;

    outline: none;

    border: 1px solid #29303d;
    border-radius: 10px;

    background: #0c0f15;

    color: #ffffff;
}

.form-group input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(106, 112, 255, 0.10);
}

.login-button {
    width: 100%;
    height: 49px;

    margin-top: 5px;

    border: 0;
    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            #7378ff,
            #565cef
        );

    color: #ffffff;

    font-weight: 700;

    cursor: pointer;
}

/* Layout */

.app {
    min-height: 100vh;
}

.sidebar {
    position: fixed;

    top: 0;
    bottom: 0;
    left: 0;

    width: var(--sidebar-width);

    padding: 21px 15px;

    background: rgba(17, 20, 27, 0.97);

    border-right: 1px solid var(--border);

    display: flex;
    flex-direction: column;

    z-index: 1000;

    overflow-y: auto;
}

html[dir="rtl"] .sidebar {
    left: auto;
    right: 0;

    border-right: 0;
    border-left: 1px solid var(--border);
}

.main {
    margin-left: var(--sidebar-width);

    min-height: 100vh;
}

html[dir="rtl"] .main {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

/* Brand */

.brand {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 7px 9px 23px;
}

.brand-logo {
    min-width: 43px;
    width: 43px;
    height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #777cff,
            #484ee5
        );

    font-size: 17px;
    font-weight: 900;

    box-shadow:
        0 8px 30px rgba(106, 112, 255, 0.24);
}

.brand-text {
    min-width: 0;
}

.brand-text strong {
    display: block;
    font-size: 16px;
}

.brand-text span {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;

    white-space: nowrap;
}

/* Navigation */

.nav {
    display: flex;
    flex-direction: column;

    flex: 1;

    gap: 5px;
}

.nav-title {
    padding: 14px 12px 6px;

    color: #60697b;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 1px;

    text-transform: uppercase;
}

.nav-link {
    min-height: 45px;

    display: flex;
    align-items: center;

    gap: 11px;

    padding: 0 12px;

    border-radius: 10px;

    color: #a4abba;

    font-size: 14px;

    transition: 0.2s;
}

.nav-link:hover {
    background: #191e28;
    color: #ffffff;
}

.nav-link.active {
    background: rgba(106, 112, 255, 0.13);
    color: #a2a6ff;
}

.nav-link.disabled {
    opacity: 0.48;

    cursor: default;
    pointer-events: none;
}

.nav-link.logout-link:hover {
    background: rgba(255, 99, 117, 0.08);
    color: #ff8b98;
}

.nav-icon {
    width: 24px;

    flex-shrink: 0;

    text-align: center;

    font-size: 16px;
}

.nav-soon {
    margin-left: auto;

    padding: 3px 6px;

    border-radius: 5px;

    background: #202530;

    color: #737d91;

    font-size: 8px;
}

html[dir="rtl"] .nav-soon {
    margin-left: 0;
    margin-right: auto;
}

/* Sidebar user */

.sidebar-user {
    margin-top: 16px;

    padding: 14px;

    background: #0d1016;

    border: 1px solid var(--border);
    border-radius: 12px;
}

.sidebar-user-name {
    overflow: hidden;

    font-size: 13px;
    font-weight: 700;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-id {
    margin-top: 5px;

    color: var(--muted);

    font-size: 11px;
}

/* Topbar */

.topbar {
    position: sticky;

    top: 0;

    height: 72px;

    padding: 0 31px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: rgba(8, 10, 15, 0.86);

    backdrop-filter: blur(15px);

    border-bottom:
        1px solid rgba(36, 42, 54, 0.75);

    z-index: 500;
}

.topbar-left,
.topbar-actions {
    display: flex;
    align-items: center;

    gap: 12px;
}

.page-title {
    font-size: 17px;
    font-weight: 700;
}

.mobile-menu-button {
    width: 41px;
    height: 41px;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--panel);

    color: #ffffff;

    cursor: pointer;

    font-size: 19px;
}

.language-button {
    min-width: 45px;
    height: 37px;

    padding: 0 11px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--panel);

    color: #c7ccd6;

    font-size: 12px;
    font-weight: 700;
}

.status {
    min-height: 37px;

    padding: 0 12px;

    display: inline-flex;
    align-items: center;

    gap: 7px;

    border-radius: 9px;

    background: rgba(69, 216, 154, 0.10);

    color: #73e3b3;

    font-size: 12px;
    font-weight: 600;
}

.status.offline {
    background: rgba(137, 146, 163, 0.10);
    color: #a3aab6;
}

.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: currentColor;
}

/* Content */

.content {
    width: 100%;
    max-width: 1500px;

    margin: 0 auto;

    padding: 33px;
}

.welcome {
    margin-bottom: 27px;
}

.welcome h1 {
    margin: 0;

    font-size: clamp(25px, 3vw, 35px);

    letter-spacing: -0.5px;
}

.welcome h1 span {
    color: #9296ff;
}

.welcome p {
    margin: 9px 0 0;

    color: var(--muted);

    font-size: 14px;

    line-height: 1.8;
}

/* Stats */

.stats {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    margin-bottom: 20px;
}

.stat-card {
    position: relative;

    min-width: 0;
    min-height: 145px;

    padding: 20px;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,0.025),
            transparent
        ),
        var(--panel);
}

.stat-card::after {
    content: "";

    position: absolute;

    top: -55px;
    right: -55px;

    width: 120px;
    height: 120px;

    border-radius: 50%;

    background: rgba(106, 112, 255, 0.07);
}

html[dir="rtl"] .stat-card::after {
    right: auto;
    left: -55px;
}

.stat-icon {
    position: absolute;

    top: 18px;
    right: 18px;

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: rgba(106, 112, 255, 0.10);

    color: #9fa3ff;

    font-size: 11px;
    font-weight: 800;
}

html[dir="rtl"] .stat-icon {
    right: auto;
    left: 18px;
}

.stat-label {
    padding-right: 45px;

    color: var(--muted);

    font-size: 12px;
}

html[dir="rtl"] .stat-label {
    padding-right: 0;
    padding-left: 45px;
}

.stat-value {
    margin-top: 17px;

    overflow-wrap: anywhere;

    font-size: clamp(20px, 2.2vw, 26px);

    font-weight: 800;
}

.stat-sub {
    margin-top: 9px;

    color: #677084;

    font-size: 11px;
}

/* Panels */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(290px, 1fr);

    gap: 20px;
}

.panel {
    min-width: 0;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--panel);
}

.panel-header {
    min-height: 59px;

    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    border-bottom: 1px solid var(--border);
}

.panel-title {
    font-size: 14px;
    font-weight: 700;
}

.panel-body {
    padding: 20px;
}

/* Character */

.character-info {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0 30px;
}

.info-row {
    min-height: 52px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    border-bottom: 1px solid #202530;
}

.info-label {
    color: var(--muted);

    font-size: 12px;
}

.info-value {
    min-width: 0;

    text-align: right;

    overflow-wrap: anywhere;

    font-size: 13px;
}

html[dir="rtl"] .info-value {
    text-align: left;
}

/* Bitcoin */

.btc-pair {
    padding: 5px 8px;

    background: rgba(255, 200, 87, 0.08);

    border-radius: 7px;

    color: var(--yellow);

    font-size: 10px;
    font-weight: 700;
}

.btc-price {
    margin-bottom: 18px;
}

.btc-price-label {
    color: var(--muted);

    font-size: 12px;
}

.btc-price-value {
    margin-top: 8px;

    overflow-wrap: anywhere;

    font-size: clamp(25px, 4vw, 34px);

    font-weight: 900;
}

.btc-balance {
    padding: 15px;

    border: 1px solid #222936;
    border-radius: 11px;

    background: var(--panel-dark);
}

.btc-balance span {
    display: block;

    color: var(--muted);

    font-size: 11px;
}

.btc-balance strong {
    display: block;

    margin-top: 7px;

    font-size: 20px;
}

/* Profile */

.profile-hero {
    display: flex;
    align-items: center;

    gap: 20px;

    margin-bottom: 20px;

    padding: 24px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background:
        linear-gradient(
            135deg,
            rgba(106, 112, 255, 0.10),
            transparent 50%
        ),
        var(--panel);
}

.profile-avatar {
    width: 78px;
    height: 78px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 22px;

    background:
        linear-gradient(
            135deg,
            #777cff,
            #4a50e8
        );

    box-shadow:
        0 15px 40px rgba(106, 112, 255, 0.22);

    font-size: 28px;
    font-weight: 900;
}

.profile-hero-info {
    min-width: 0;
}

.profile-hero-info h2 {
    margin: 0 0 10px;

    overflow-wrap: anywhere;

    font-size: 24px;
}

.profile-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;

    color: var(--muted);

    font-size: 12px;
}

.profile-meta > span {
    padding: 6px 9px;

    border-radius: 7px;

    background: rgba(255, 255, 255, 0.035);
}

.mini-status.good {
    color: var(--green);
}

.profile-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;
}

.profile-info-list {
    width: 100%;
}

.profile-info-row {
    min-height: 54px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    border-bottom: 1px solid #202530;
}

.profile-info-row:last-child {
    border-bottom: 0;
}

.profile-info-row > span {
    color: var(--muted);

    font-size: 12px;
}

.profile-info-row > strong {
    min-width: 0;

    overflow-wrap: anywhere;

    text-align: right;

    font-size: 13px;
}

html[dir="rtl"] .profile-info-row > strong {
    text-align: left;
}

.text-success {
    color: var(--green) !important;
}

.text-warning {
    color: var(--yellow) !important;
}

.text-danger {
    color: var(--red) !important;
}

/* Vehicles */

.vehicle-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;
}

.vehicle-count-box {
    min-width: 145px;

    padding: 14px 18px;

    border: 1px solid var(--border);
    border-radius: 13px;

    background: var(--panel);
}

.vehicle-count-box span {
    display: block;

    color: var(--muted);

    font-size: 11px;
}

.vehicle-count-box strong {
    display: block;

    margin-top: 5px;

    font-size: 24px;
}

.vehicle-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;
}

.vehicle-card {
    min-width: 0;

    padding: 20px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,0.025),
            transparent
        ),
        var(--panel);
}

.vehicle-card-top {
    display: flex;
    align-items: center;

    gap: 13px;

    margin-bottom: 15px;
}

.vehicle-model-icon {
    width: 48px;
    height: 48px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;

    background: rgba(106, 112, 255, 0.11);

    color: #9ea2ff;

    font-size: 20px;
}

.vehicle-name {
    font-size: 17px;
    font-weight: 800;
}

.vehicle-id {
    margin-top: 4px;

    color: var(--muted);

    font-size: 11px;
}

.vehicle-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 7px;

    margin-bottom: 18px;
}

.vehicle-badge {
    padding: 5px 8px;

    border-radius: 7px;

    background: #1b202a;

    color: #9da5b4;

    font-size: 10px;
    font-weight: 700;
}

.vehicle-badge.success {
    background: rgba(69, 216, 154, 0.09);

    color: var(--green);
}

.vehicle-badge.danger {
    background: rgba(255, 99, 117, 0.09);

    color: var(--red);
}

.vehicle-health {
    margin-bottom: 19px;
}

.vehicle-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 8px;

    font-size: 11px;
}

.vehicle-progress-header span {
    color: var(--muted);
}

.progress-track {
    width: 100%;
    height: 6px;

    overflow: hidden;

    border-radius: 100px;

    background: #202530;
}

.progress-bar {
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #666dff,
            #858aff
        );
}

.vehicle-info-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 1px;

    overflow: hidden;

    border: 1px solid #202530;
    border-radius: 11px;

    background: #202530;
}

.vehicle-info-item {
    min-width: 0;

    padding: 13px;

    background: #0e1117;
}

.vehicle-info-item span {
    display: block;

    margin-bottom: 5px;

    color: var(--muted);

    font-size: 10px;
}

.vehicle-info-item strong {
    display: block;

    overflow-wrap: anywhere;

    font-size: 12px;
}

.empty-state {
    padding: 70px 25px;

    text-align: center;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--panel);
}

.empty-state-icon {
    width: 65px;
    height: 65px;

    margin: 0 auto 17px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 18px;

    background: rgba(106, 112, 255, 0.10);

    color: #999eff;

    font-size: 25px;
}

.empty-state h2 {
    margin: 0;

    color: var(--muted);

    font-size: 15px;
    font-weight: 500;
}

/* Overlay */

.sidebar-overlay {
    display: none;
}

/* Tablet */

@media (max-width: 1150px) {

    .stats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .vehicle-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile */

@media (max-width: 800px) {

    .sidebar {
        width: min(82vw, 290px);

        transform: translateX(-105%);

        transition:
            transform 0.25s ease;
    }

    html[dir="rtl"] .sidebar {
        transform: translateX(105%);
    }

    .sidebar.open,
    html[dir="rtl"] .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;

        inset: 0;

        display: block;

        visibility: hidden;
        opacity: 0;

        background: rgba(0, 0, 0, 0.67);

        transition: 0.25s;

        z-index: 900;
    }

    .sidebar-overlay.active {
        visibility: visible;
        opacity: 1;
    }

    .main,
    html[dir="rtl"] .main {
        margin: 0;
    }

    .mobile-menu-button {
        display: flex;
    }

    .topbar {
        height: 65px;

        padding: 0 15px;
    }

    .content {
        padding: 22px 15px 35px;
    }

    .character-info {
        grid-template-columns: 1fr;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .vehicle-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .vehicle-count-box {
        width: 100%;
    }
}

/* Small mobile */

@media (max-width: 560px) {

    .login-layout {
        padding: 75px 15px 25px;
    }

    .login-card {
        padding: 27px 21px;

        border-radius: 18px;
    }

    .login-card h1 {
        font-size: 25px;
    }

    .login-language {
        top: 15px;
        right: 15px;
    }

    html[dir="rtl"] .login-language {
        left: 15px;
        right: auto;
    }

    .page-title {
        display: none;
    }

    .topbar-actions {
        gap: 7px;
    }

    .status {
        padding: 0 9px;
    }

    .language-button {
        min-width: 42px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .stat-card {
        min-height: 125px;
    }

    .welcome h1 {
        font-size: 25px;
    }

    .panel-header {
        padding: 0 16px;
    }

    .panel-body {
        padding: 16px;
    }

    .info-row {
        min-height: 0;

        padding: 12px 0;

        align-items: flex-start;
        flex-direction: column;

        gap: 5px;
    }

    .info-value,
    html[dir="rtl"] .info-value {
        text-align: inherit;
    }

    .profile-hero {
        align-items: flex-start;

        padding: 18px;
    }

    .profile-avatar {
        width: 60px;
        height: 60px;

        border-radius: 16px;

        font-size: 22px;
    }

    .profile-hero-info h2 {
        font-size: 19px;
    }

    .profile-info-row {
        min-height: 0;

        padding: 12px 0;

        align-items: flex-start;
        flex-direction: column;

        gap: 5px;
    }

    .profile-info-row > strong,
    html[dir="rtl"] .profile-info-row > strong {
        text-align: inherit;
    }

    .vehicle-card {
        padding: 16px;
    }

    .vehicle-info-grid {
        grid-template-columns: 1fr;
    }
}