:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --accent-color: #38bdf8;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success: #22c55e;
    --pending: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

header {
    padding: 20px;
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    text-align: center;
}

.tabs {
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--card-bg);
    color: var(--accent-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

main {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.car-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    animation: slideUp 0.4s ease-out;
}

.car-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.car-brand {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.car-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
}

.progress-container {
    margin-top: 6px;
    background: rgba(0, 0, 0, 0.1);
    padding: 6px 8px;
    border-radius: 8px;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #818cf8);
    transition: width 0.5s ease-out;
}

.task-summary {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.task-list {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.service-tabs {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    overflow-x: auto;
    scrollbar-width: none;
    margin-top: 4px;
}

.service-tabs::-webkit-scrollbar {
    display: none;
}

.service-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.service-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.stats-bar {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-around;
    font-size: 0.8rem;
    animation: fadeIn 0.5s ease;
}

.stats-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stats-value {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 1rem;
}

.stats-label {
    opacity: 0.5;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-icon.done {
    background: var(--success);
    position: relative;
}

.status-icon.done::after {
    content: '✓';
    color: white;
    font-size: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.status-icon.pending {
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.loader {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
}

.period-selector select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    outline: none;
    cursor: pointer;
}

#modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-header {
    margin-bottom: 15px;
}

.modal-header h3 {
    font-size: 1.1rem;
    margin: 0;
}

.price-edit-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    margin: 15px 0;
    box-sizing: border-box;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-save {
    flex: 1;
    background: var(--success);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.btn-cancel {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
}

.task-item {
    cursor: pointer;
    transition: opacity 0.2s;
}

.task-item:hover {
    opacity: 0.8;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
