* {
    box-sizing: border-box;
}

:root {
    --bg: #090b0d;
    --sidebar: #0d1013;
    --panel: #111519;
    --panel2: #151a1f;
    --border: rgba(255,255,255,.075);
    --text: #f5f7f8;
    --muted: #7f8992;
    --accent: #d8ff3e;
    --accent-soft: rgba(216,255,62,.10);
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    min-height: 100vh;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 25px 18px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 25px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #090b0d;
    border-radius: 12px;
    font-size: 21px;
    font-weight: 900;
}

.brand strong {
    display: block;
    letter-spacing: .14em;
}

.brand span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-top: 3px;
    letter-spacing: .12em;
}

nav {
    flex: 1;
}

.nav-label {
    color: #4f5961;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
    margin: 25px 10px 8px;
}

.nav-item {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 12px;
    margin: 3px 0;
    border-radius: 9px;
    color: #a8b0b7;
    text-decoration: none;
    font-size: 14px;
    transition: .15s ease;
}

.nav-item:hover {
    background: rgba(255,255,255,.04);
    color: white;
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-icon {
    width: 19px;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 20px 8px 0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.sidebar-footer strong,
.sidebar-footer span {
    display: block;
    font-size: 12px;
}

.sidebar-footer span {
    color: var(--muted);
    margin-top: 3px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 14px rgba(216,255,62,.6);
}

.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 90px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
}

.eyebrow,
.panel-kicker {
    color: var(--accent);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .18em;
}

h1 {
    font-size: 23px;
    margin: 5px 0 0;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--panel2);
    border: 1px solid var(--border);
    font-weight: 800;
}

.admin-user strong,
.admin-user span {
    display: block;
    font-size: 12px;
}

.admin-user span {
    color: var(--muted);
    margin-top: 2px;
}

.content {
    padding: 34px 36px 50px;
    max-width: 1500px;
}

.hero-panel {
    min-height: 190px;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        radial-gradient(circle at 85% 20%, rgba(216,255,62,.08), transparent 30%),
        var(--panel);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero-panel h2 {
    font-size: clamp(26px, 4vw, 42px);
    margin: 16px 0 8px;
    max-width: 750px;
}

.hero-panel p {
    color: var(--muted);
    margin: 0;
    max-width: 600px;
    line-height: 1.6;
}

.pill {
    display: inline-flex;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
}

.hero-status {
    text-align: right;
    padding: 25px;
}

.hero-status span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.hero-status strong {
    display: block;
    color: var(--accent);
    font-size: 22px;
    margin-top: 5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 16px;
}

.stat-card,
.panel {
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: 14px;
}

.stat-card {
    padding: 20px;
}

.stat-card span,
.stat-card small {
    display: block;
    color: var(--muted);
}

.stat-card span {
    font-size: 12px;
}

.stat-card strong {
    display: block;
    font-size: 30px;
    margin: 10px 0 5px;
}

.stat-card small {
    font-size: 10px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 16px;
    margin-top: 16px;
}

.panel {
    padding: 23px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel h3 {
    margin: 5px 0 0;
    font-size: 18px;
}

.status {
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 10px;
}

.status.success {
    background: var(--accent-soft);
    color: var(--accent);
}

.system-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--border);
    padding: 14px 0;
    font-size: 12px;
}

.system-row span {
    color: var(--muted);
}

.green {
    color: var(--accent);
}

.muted {
    color: var(--muted);
    line-height: 1.6;
}

code {
    color: var(--accent);
}

.database-preview {
    margin-top: 18px;
}

.database-preview > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding: 12px 0;
}

.database-preview strong {
    font-size: 12px;
}

.database-preview span {
    color: var(--muted);
    font-size: 11px;
}

@media(max-width: 950px) {
    .sidebar {
        width: 210px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media(max-width: 700px) {
    .sidebar {
        display: none;
    }

    .topbar,
    .content {
        padding-left: 20px;
        padding-right: 20px;
    }

    .admin-user div:not(.admin-avatar) {
        display: none;
    }

    .hero-status {
        display: none;
    }
}

@media(max-width: 500px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   USERS
   ========================================================= */

.page-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 22px;
}

.page-intro h2 {
    margin: 7px 0 5px;
    font-size: 31px;
}

.page-intro p {
    margin: 0;
}

.user-count {
    color: var(--muted);
    font-size: 12px;
}


.user-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.user-filter input,
.user-filter select {
    height: 45px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    color: white;
    outline: none;
    padding: 0 14px;
}

.user-filter input {
    flex: 1;
}

.user-filter select {
    min-width: 160px;
}

.user-filter button {
    border: 0;
    border-radius: 10px;
    padding: 0 20px;
    background: var(--accent);
    color: #080a0b;
    font-weight: 800;
    cursor: pointer;
}

.filter-reset {
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
}


.user-table-panel {
    padding: 0;
    overflow: hidden;
}

.user-table {
    width: 100%;
}

.user-row {
    display: grid;
    grid-template-columns:
        minmax(260px, 2fr)
        .65fr
        1fr
        .7fr
        .7fr
        1fr
        30px;

    align-items: center;
    gap: 15px;
}

.user-row-head {
    min-height: 48px;
    padding: 0 20px;
    color: #566069;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .1em;
    border-bottom: 1px solid var(--border);
}

.user-row-data {
    min-height: 78px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
    transition: .15s ease;
}

.user-row-data:last-child {
    border-bottom: 0;
}

.user-row-data:hover {
    background: rgba(255,255,255,.025);
}

.user-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.user-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 900;
}

.user-main strong,
.user-main span,
.user-main small {
    display: block;
}

.user-main strong {
    font-size: 13px;
}

.user-main span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.user-main small {
    margin-top: 3px;
    color: #59636b;
    font-size: 10px;
}

.user-status {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 9px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.user-status.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.user-status.inactive {
    color: #ff9d9d;
    background: rgba(255,80,80,.08);
}

.metric-cell strong,
.metric-cell span {
    display: block;
}

.metric-cell strong {
    font-size: 12px;
}

.metric-cell span {
    color: var(--muted);
    font-size: 9px;
    margin-top: 4px;
}

.user-open {
    color: #626d75;
    font-size: 24px;
    text-align: right;
}

.empty-state {
    padding: 35px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.empty-state.compact {
    padding: 15px 0;
}


/* USER PROFILE */

.back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
}

.back-link:hover {
    color: white;
}

.user-profile-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 27px;
    border: 1px solid var(--border);
    background:
        radial-gradient(
            circle at 80% 0%,
            rgba(216,255,62,.07),
            transparent 30%
        ),
        var(--panel);
    border-radius: 17px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #080a0b;
    font-size: 30px;
    font-weight: 900;
}

.profile-identity {
    flex: 1;
}

.profile-identity h2 {
    margin: 5px 0 7px;
    font-size: 30px;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-meta > span {
    color: var(--muted);
    font-size: 11px;
}

.profile-meta > span + span::before {
    content: "·";
    margin-right: 8px;
    color: #40484e;
}

.profile-meta .plate {
    color: white;
}

.profile-state {
    text-align: right;
}

.profile-state small {
    display: block;
    color: var(--muted);
    margin-top: 8px;
    text-transform: uppercase;
    font-size: 9px;
}


.profile-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.profile-stat {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--panel);
}

.profile-stat span,
.profile-stat small {
    display: block;
    color: var(--muted);
}

.profile-stat span {
    font-size: 10px;
}

.profile-stat strong {
    display: block;
    margin: 7px 0 4px;
    font-size: 23px;
}

.profile-stat small {
    font-size: 9px;
}


.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr);
    gap: 15px;
    margin-top: 15px;
}

.profile-main-column,
.profile-side-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}


.exploration-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.exploration-grid > div {
    padding: 15px;
    background: #0c0f12;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.exploration-grid span,
.exploration-grid strong {
    display: block;
}

.exploration-grid span {
    color: var(--muted);
    font-size: 9px;
}

.exploration-grid strong {
    margin-top: 7px;
    font-size: 18px;
}


.drive-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}

.drive-item:first-child {
    border-top: 0;
}

.drive-item > div:first-child strong,
.drive-item > div:first-child span {
    display: block;
}

.drive-item > div:first-child strong {
    font-size: 12px;
}

.drive-item > div:first-child span {
    color: var(--muted);
    font-size: 9px;
    margin-top: 4px;
}

.drive-metrics {
    display: flex;
    gap: 28px;
    text-align: right;
}

.drive-metrics strong,
.drive-metrics span {
    display: block;
}

.drive-metrics strong {
    font-size: 11px;
}

.drive-metrics span {
    color: var(--muted);
    font-size: 8px;
    margin-top: 3px;
}

.drive-metrics .new-road strong {
    color: var(--accent);
}


.region-item {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) 1.5fr 80px;
    align-items: center;
    gap: 20px;
    padding: 13px 0;
    border-top: 1px solid var(--border);
}

.region-item:first-child {
    border-top: 0;
}

.region-info strong,
.region-info span {
    display: block;
}

.region-info strong {
    font-size: 11px;
}

.region-info span {
    color: var(--muted);
    font-size: 9px;
    margin-top: 3px;
}

.region-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.region-progress > span {
    width: 60px;
    color: var(--muted);
    font-size: 9px;
    text-align: right;
}

.progress-track {
    flex: 1;
    height: 6px;
    overflow: hidden;
    border-radius: 99px;
    background: #080a0b;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.region-km {
    text-align: right;
    font-size: 11px;
}


.detail-list {
    margin-top: 15px;
}

.detail-list > div {
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.detail-list span,
.detail-list strong {
    display: block;
}

.detail-list span {
    color: var(--muted);
    font-size: 9px;
}

.detail-list strong {
    margin-top: 5px;
    font-size: 11px;
    word-break: break-word;
}


.vehicle-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 13px 0;
    border-top: 1px solid var(--border);
}

.vehicle-card:first-child {
    margin-top: 10px;
}

.vehicle-card strong,
.vehicle-card span {
    display: block;
}

.vehicle-card strong {
    font-size: 11px;
}

.vehicle-card > div span {
    color: var(--muted);
    font-size: 9px;
    margin-top: 4px;
}

.primary-badge {
    color: var(--accent);
    font-size: 8px !important;
    font-weight: 900;
    letter-spacing: .08em;
}


.admin-warning {
    font-size: 10px;
}

.admin-action-button {
    width: 100%;
    height: 40px;
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #151a1f;
    color: #5c656c;
    font-weight: 700;
}

.admin-action-button.danger {
    color: #765151;
}


@media(max-width: 1150px) {

    .user-row {
        grid-template-columns:
            minmax(230px, 2fr)
            .7fr
            1fr
            .7fr
            30px;
    }

    .user-row > :nth-child(5),
    .user-row > :nth-child(6) {
        display: none;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }
}


@media(max-width: 850px) {

    .profile-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .exploration-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
