:root {
    --bg-dark: #0A0A0B;
    --card-bg: rgba(22, 22, 24, 0.7);
    --accent: #00ACC1;
    --accent-light: #4DD0E1;
    --text-main: #E0E0E0;
    --text-dim: #9E9E9E;
    --success: #00E676;
    --border: rgba(255, 255, 255, 0.08);
    --glass: blur(10px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, .logo {
    font-family: 'Outfit', sans-serif;
}

.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(0, 172, 193, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(0, 172, 193, 0.03) 0%, transparent 40%);
    z-index: -1;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    color: var(--accent);
    font-weight: 400;
}

.logo .icon {
    color: var(--accent);
}

nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.offline-ready {
    font-size: 11px;
    color: var(--success);
    background: rgba(0, 230, 118, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--accent), var(--accent-light));
}

.primary-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 172, 193, 0.3);
}

/* Hero Section */
.hero {
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.hero h1 span {
    color: var(--accent);
}

.hero p {
    color: var(--text-dim);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

/* Sidebar */
.sidebar-header {
    margin-bottom: 20px;
}

#vehicle-list {
    list-style: none;
}

#vehicle-list li {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

#vehicle-list li:hover {
    background: rgba(255, 255, 255, 0.03);
}

#vehicle-list li.active {
    background: rgba(0, 172, 193, 0.1);
    border-color: rgba(0, 172, 193, 0.3);
}

.tab-link {
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    color: var(--text-dim);
}

.tab-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.tab-link.active {
    color: var(--accent);
    background: rgba(0, 172, 193, 0.1);
}

.v-model {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.v-vin {
    font-size: 12px;
    color: var(--text-dim);
    font-family: monospace;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.title-group h2 {
    font-size: 20px;
    font-family: monospace;
    margin-bottom: 8px;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge.success {
    background: rgba(0, 230, 118, 0.1);
    color: var(--success);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card label {
    font-size: 13px;
    color: var(--text-dim);
    display: block;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

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

.trend.up { color: var(--success); }
.trend.stable { color: var(--accent); }

/* Coding & Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    max-width: 800px;
    margin: 50px auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.close-modal { cursor: pointer; font-size: 24px; }

.coding-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
    margin-bottom: 20px;
}

.byte-box {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    padding: 8px;
    text-align: center;
    font-family: monospace;
    cursor: pointer;
    border-radius: 4px;
}

.byte-box.active {
    background: var(--accent);
    color: white;
}

.bit-helper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 20px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}

.bit-helper label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.modal-footer {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hex-summary { font-family: monospace; font-size: 18px; color: var(--accent); }

/* History list */
.history-item {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}

.history-item:last-child { border: none; }

/* Hardware & DTC Specific */
.hardware-status.connected {
    border-color: var(--success);
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.1);
}

.hardware-status.connected .value {
    color: var(--success);
}

.dtc-list {
    list-style: none;
    margin-top: 10px;
}

.dtc-list li {
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

.dtc-list li.empty {
    color: var(--text-dim);
    text-align: center;
    border: 1px dashed var(--border);
    background: transparent;
}

.dtc-code {
    color: #FF5252;
    font-weight: 700;
    font-family: monospace;
}

/* Animations */
.animate-in {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.blue { background: var(--accent); }
.dot.yellow { background: #FFCA28; }

.chart-wrapper {
    height: 300px;
    width: 100%;
}

/* Table Section */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 12px;
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.code {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
    margin-right: 4px;
}

.text-success {
    color: var(--success);
    font-weight: 600;
}

/* Animations */
.animate-in {
    animation: slideUp 0.6s ease-out forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 20px;
    }
}
