:root {
    --primary: #4f46e5;
    --primary-light: #e0e7ff;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --success: #10b981;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-color);
    min-height: 100vh;
    position: relative;
    padding-bottom: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

.mt-4 { margin-top: 24px; }
.mt-3 { margin-top: 16px; }

/* Header */
.header {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    padding: 24px 20px;
    padding-bottom: 50px;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    display: flex;
    justify-content: center;
    text-align: center;
    color: white;
}

.header h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
}

.header .plate {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 8px;
    display: inline-block;
    backdrop-filter: blur(10px);
}

/* Mileage Card */
.mileage-card {
    background: var(--card-bg);
    margin: -30px 20px 24px;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    text-align: center;
    position: relative;
    z-index: 2;
}

.mileage-card h2 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.odometer {
    font-size: 40px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 16px;
}

.odometer span {
    letter-spacing: -2px;
}

.status.good {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #d1fae5;
    color: #065f46;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Action Section */
.action-section {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.action-btn {
    display: flex;
    align-items: center;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 20px 16px;
    border-radius: 20px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.action-btn:active {
    transform: scale(0.98);
}

.action-btn.primary {
    border-color: #c7d2fe;
    background: linear-gradient(to right, #ffffff, #eef2ff);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.08);
}

.icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 16px;
    flex-shrink: 0;
}

.info-icon {
    background: #f1f5f9;
    color: #64748b;
}

.maint-icon {
    background: var(--primary-light);
    color: var(--primary);
}

.action-content {
    flex-grow: 1;
}

.action-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.action-content p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.text-primary {
    color: var(--primary) !important;
}

.arrow-icon {
    color: #cbd5e1;
    font-size: 16px;
}

/* Form Styles */
.input-group {
    background: var(--bg-color);
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}
.input-group input:focus { outline: none; }

.km-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: 12px;
    border: 2px solid transparent;
}
.km-input-wrapper:focus-within {
    border-color: var(--primary);
}
.km-input-wrapper input {
    padding: 14px 44px 14px 16px;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    background: transparent;
}
.km-input-wrapper .unit {
    position: absolute;
    right: 16px;
    font-weight: 700;
    color: var(--text-muted);
}

.section-subtitle {
    display: block;
    font-size: 16px;
    font-weight: 700;
    margin: 24px 0 16px;
    color: var(--text-main);
}

/* Services List */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 20px;
}

.service-card {
    display: block;
    cursor: pointer;
}

.service-card input[type="checkbox"] {
    display: none;
}

.card-content {
    background: var(--bg-color);
    padding: 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.card-content .icon {
    font-size: 22px;
    color: #9ca3af;
    width: 36px;
}

.service-name {
    flex-grow: 1;
    font-weight: 600;
    font-size: 15px;
    color: #374151;
}

.checkbox-indicator {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 2px solid #d1d5db;
    position: relative;
    transition: all 0.2s;
    background: var(--card-bg);
}

.service-card input[type="checkbox"]:checked + .card-content {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.service-card input[type="checkbox"]:checked + .card-content .icon,
.service-card input[type="checkbox"]:checked + .card-content .service-name {
    color: var(--primary);
}

.service-card input[type="checkbox"]:checked + .card-content .checkbox-indicator {
    background-color: var(--primary);
    border-color: var(--primary);
}

.service-card input[type="checkbox"]:checked + .card-content .checkbox-indicator::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
}

/* History */
.history-section {
    padding: 0 20px;
}
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-main);
}
.history-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-left: 2px dashed #d1d5db;
    margin-left: 14px;
    padding-left: 24px;
    position: relative;
}
.history-item { position: relative; }
.history-item::before {
    content: '';
    position: absolute;
    left: -33px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary);
    border: 4px solid var(--bg-color);
}
.history-date {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
    display: inline-block;
    background: #e5e7eb;
    padding: 4px 10px;
    border-radius: 6px;
}
.history-card {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.history-km {
    font-weight: 800;
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.history-services {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    font-weight: 500;
}

/* Modal Bottom Sheet */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.bottom-sheet {
    background: var(--card-bg);
    width: 100%;
    max-width: 480px;
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
    padding: 24px 24px 40px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* Don't cover entire screen */
}

.form-sheet {
    padding-bottom: 0px; /* Adjust for sticky bar */
}

.modal-overlay.active .bottom-sheet {
    transform: translateY(0);
}

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

.sheet-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.close-btn {
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    color: var(--text-main);
    cursor: pointer;
}

.sheet-scrollable {
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Bottom elements */
.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}
.btn-primary:active {
    background: #4338ca;
    transform: scale(0.98);
}

.bottom-sticky-bar {
    padding: 16px 24px 24px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    margin: 0 -24px;
}

/* Custom Filter & View More */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.history-header .section-title {
    margin-bottom: 0;
}
.btn-filter {
    background: var(--bg-color);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.btn-filter:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-light);
}

.btn-secondary {
    width: 100%;
    background: #f3f4f6;
    color: #4b5563;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}
.btn-secondary:active {
    background: #e5e7eb;
    transform: scale(0.98);
}

.btn-view-more {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s;
}
.btn-view-more:hover {
    background: #e5e7eb;
    color: var(--text-main);
}
.m-0 { margin: 0; }
.text-center { text-align: center; }

/* Filter Active State */
.btn-filter.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #10b981;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast.show {
    transform: translateX(-50%) translateY(0);
}
.toast.error {
    background: #ef4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Login Container */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-color);
}
.login-card {
    background: var(--card-bg);
    padding: 32px 24px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    width: 90%;
    max-width: 400px;
    text-align: center;
}
.login-card h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
}
.login-card p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}
.styled-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    background: #f9fafb;
    box-sizing: border-box;
}
.styled-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.mb-3 { margin-bottom: 12px; }
.mt-4 { margin-top: 24px; }
