:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --accent: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    padding: 2rem;
    line-height: 1.6;
}

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

header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
}

.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.btn, .btn-clear {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-clear {
    background: #f1f5f9;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-clear:hover {
    background: #e2e8f0;
}

input, select {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    outline: none;
    flex: 1;
}

/* Dashboard Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border-radius: 1rem;
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.vin-tag {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.ecu-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--border);
}

.hw-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    font-weight: 700;
    font-family: monospace;
    border: 1px solid var(--border);
    display: inline-block;
    margin-right: 0.5rem;
}

.hw-cc { background: #eff6ff; color: #1e40af; }
.hw-cb { background: #f0fdf4; color: #166534; }

.pn-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.pn-tag {
    font-size: 0.8rem;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.2rem 0.6rem;
    border-radius: 0.4rem;
    color: var(--text);
    font-weight: 500;
    font-family: monospace;
}

.year-tag {
    background: #fef3c7;
    color: #92400e;
    padding: 0.15rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.7rem;
    font-weight: 800;
    margin-left: 0.5rem;
}

/* Lab Layout */
.main-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
}

.sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    height: calc(100vh - 12rem);
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.cal-item {
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    border: 1px solid transparent;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.cal-item:hover { background: #f1f5f9; }
.cal-item.active { background: #eff6ff; border-color: var(--primary); }
.cal-item.selected { background: #f0fdf4; border-color: var(--accent); }

.cal-item .vin { font-weight: 700; display: block; font-size: 0.9rem; }
.cal-item .ecu { font-size: 0.75rem; color: var(--text-muted); }

/* Tables */
.mod-table {
    width: 100%;
    border-collapse: collapse;
}

.mod-table th {
    text-align: left;
    padding: 1rem;
    background: #f8fafc;
    border-bottom: 2px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mod-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.note-input {
    width: 100%;
    min-height: 60px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    resize: vertical;
}

/* FAB */
.compare-fab-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: none;
    align-items: center;
    gap: 0.75rem;
}

.compare-fab {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 2rem;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: none;
}

/* Action Buttons */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: 0.5rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--primary);
}

/* Comparison Overlay Modal */
.comparison-overlay {
    position: fixed;
    top: 2rem;
    left: 2rem;
    right: 2rem;
    bottom: 2rem;
    background: white;
    z-index: 1000;
    border-radius: 1.5rem;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    padding: 2rem;
    border: 2px solid var(--primary);
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.comparison-content {
    overflow: auto;
    flex: 1;
}

.multi-compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.multi-compare-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 10;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
    font-size: 0.85rem;
}

.multi-compare-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

