:root {
    --yellow: #ccff00;
    --dark: #1F1F1F;
    --card-bg: #ffffff;
    --grey-light: #f5f5f5;
    --grey-border: #e0e0e0;
    --text-muted: #888;
    --red: #e53e3e;
    --green: #38a169;
    --nav-height: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f0f0f0; color: var(--dark); }

/* NAV */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--nav-height);
    background: var(--dark);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
}
.nav-brand { font-weight: 800; font-size: 1.1rem; color: #fff; letter-spacing: -0.02em; text-decoration: none; }
.nav-brand span { color: var(--yellow); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-user { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.nav-link { color: rgba(255,255,255,0.7); font-size: 0.82rem; text-decoration: none; }
.nav-link:hover { color: #fff; }
.nav-logout { background: none; border: 1px solid rgba(255,255,255,0.3); color: rgba(255,255,255,0.8); border-radius: 6px; padding: 5px 12px; font-size: 0.8rem; cursor: pointer; }
.nav-logout:hover { border-color: rgba(255,255,255,0.6); color: #fff; }

/* MAIN CONTENT */
.page { padding-top: calc(var(--nav-height) + 24px); max-width: 1100px; margin: 0 auto; padding-left: 16px; padding-right: 16px; padding-bottom: 48px; }

/* PANELS */
.panel { background: var(--card-bg); border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); }
.panel-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--yellow); display: inline-block; }

/* SECTION HEADER */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }

/* BUTTONS */
.btn-primary { background: var(--yellow); color: var(--dark); border: none; border-radius: 8px; padding: 10px 18px; font-weight: 700; font-size: 0.9rem; cursor: pointer; }
.btn-primary:hover { background: #b8e800; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--grey-light); color: var(--dark); border: 1px solid var(--grey-border); border-radius: 8px; padding: 10px 18px; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.btn-secondary:hover { background: #e8e8e8; }
.btn-danger { background: #fff0f0; color: var(--red); border: 1px solid #fcc; border-radius: 8px; padding: 10px 18px; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.btn-danger:hover { background: #ffe0e0; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* FORMS */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 600; color: #555; margin-bottom: 5px; }
input[type=text], input[type=tel], input[type=email], input[type=number],
input[type=date], input[type=password], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--grey-border);
    border-radius: 8px; font-size: 0.9rem; background: #fff; color: var(--dark);
    appearance: none; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(204,255,0,0.2); }
textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* VEHICLE GRID */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.vehicle-card {
    background: var(--card-bg); border-radius: 12px; padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07); border: 2px solid transparent;
}
.vehicle-card:hover { border-color: var(--yellow); }
.vehicle-card-active { border-color: #f97316; }
.vehicle-card-active:hover { border-color: #ea580c; }
.vehicle-card-name { font-weight: 700; font-size: 1rem; margin-bottom: 2px; }
.vehicle-card-sub { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; }
.vehicle-card-last { font-size: 0.73rem; color: var(--text-muted); margin-bottom: 14px; }
.vehicle-card-actions { display: flex; gap: 8px; }

/* WORK ORDER CARDS */
.work-order-list { display: flex; flex-direction: column; gap: 10px; }
.work-order-card {
    background: #fffef0; border: 1px solid #e8e800; border-left: 4px solid var(--yellow);
    border-radius: 10px; padding: 14px 16px;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.work-order-info { flex: 1; min-width: 0; }
.work-order-vehicle { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 3px; }
.work-order-desc { font-weight: 600; font-size: 0.92rem; margin-bottom: 4px; }
.work-order-meta { font-size: 0.76rem; color: var(--text-muted); }
.work-order-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; padding: 24px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); line-height: 1; padding: 0 4px; }

/* HISTORY */
.history-list { display: flex; flex-direction: column; gap: 14px; }
.history-item { border: 1px solid var(--grey-border); border-radius: 10px; padding: 14px 16px; }
.history-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.history-item-date { font-weight: 700; font-size: 0.9rem; }
.history-item-by { font-size: 0.76rem; color: var(--text-muted); }
.history-item-work { font-size: 0.9rem; margin-bottom: 6px; line-height: 1.4; }
.history-item-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.76rem; color: var(--text-muted); }
.history-item-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.history-photo-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 1px solid var(--grey-border); }

/* PHOTO UPLOAD */
.photo-upload-area { border: 2px dashed var(--grey-border); border-radius: 10px; padding: 20px; text-align: center; cursor: pointer; color: var(--text-muted); font-size: 0.85rem; margin-top: 6px; }
.photo-upload-area:hover { border-color: var(--yellow); }
.photo-preview-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-preview-item { position: relative; }
.photo-preview-item img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--grey-border); display: block; }
.photo-preview-remove { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 0.88rem; }

/* BADGE */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.badge-tech { background: #e8f5e9; color: #2e7d32; }
.badge-admin { background: #e3f2fd; color: #1565c0; }
.badge-requester { background: #fff3e0; color: #e65100; }
.badge-active { background: #e8f5e9; color: #2e7d32; }
.badge-inactive { background: #f5f5f5; color: #999; }

/* LIGHTBOX */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 1000; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.lightbox img { max-width: 95vw; max-height: 95vh; object-fit: contain; border-radius: 8px; }

/* LOGIN */
.login-page { min-height: 100vh; background: var(--dark); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #2a2a2a; border-radius: 20px; padding: 36px 32px; width: 100%; max-width: 380px; }
.login-brand { font-size: 1.6rem; font-weight: 800; color: #fff; margin-bottom: 4px; }
.login-brand span { color: var(--yellow); }
.login-sub { font-size: 0.85rem; color: rgba(255,255,255,0.45); margin-bottom: 32px; }
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-btn { background: #333; border: 2px solid #444; color: #fff; border-radius: 10px; padding: 12px 16px; text-align: left; cursor: pointer; font-size: 0.95rem; font-weight: 600; }
.user-btn:hover { border-color: var(--yellow); }
.user-btn.selected { border-color: var(--yellow); background: #2a2e00; }
.pin-section { margin-top: 20px; }
.pin-label { font-size: 0.8rem; color: rgba(255,255,255,0.55); margin-bottom: 8px; }
.pin-input { width: 100%; padding: 12px; background: #333; border: 2px solid #444; border-radius: 10px; color: #fff; font-size: 1.1rem; letter-spacing: 0.3em; text-align: center; font-family: inherit; }
.pin-input:focus { outline: none; border-color: var(--yellow); }
.login-btn { width: 100%; margin-top: 14px; padding: 13px; background: var(--yellow); border: none; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; color: var(--dark); }
.login-btn:hover { background: #b8e800; }
.login-error { color: #ff6b6b; font-size: 0.82rem; margin-top: 10px; text-align: center; min-height: 20px; }

/* TABS */
.tabs { display: flex; gap: 2px; background: var(--grey-light); border-radius: 10px; padding: 3px; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 8px; border: none; border-radius: 8px; background: transparent; font-size: 0.85rem; font-weight: 600; cursor: pointer; color: var(--text-muted); font-family: inherit; }
.tab-btn.active { background: #fff; color: var(--dark); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* ADMIN TABLE */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); padding: 8px 12px; border-bottom: 1px solid var(--grey-border); }
.admin-table td { padding: 11px 12px; border-bottom: 1px solid #f0f0f0; font-size: 0.88rem; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }

/* STAGE PROGRESS BAR */
.stage-progress { display: flex; align-items: flex-start; margin-bottom: 28px; }
.stage-step { display: flex; flex-direction: column; align-items: center; }
.stage-circle { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; font-weight: 700; border: 2px solid var(--grey-border); background: #fff; color: var(--text-muted); flex-shrink: 0; }
.stage-circle.done { background: var(--yellow); border-color: var(--yellow); color: var(--dark); }
.stage-circle.active { border-color: var(--dark); color: var(--dark); background: #fff; }
.stage-step-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-top: 6px; text-align: center; }
.stage-step-label.done, .stage-step-label.active { color: var(--dark); }
.stage-connector { flex: 1; height: 2px; background: var(--grey-border); margin: 19px 6px 0; }
.stage-connector.done { background: var(--yellow); }

/* STAGE CARDS */
.stage-card { background: var(--card-bg); border-radius: 12px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); overflow: hidden; }
.stage-card-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--grey-border); }
.stage-card-header.done { background: #fafff0; border-bottom-color: #e0f0b0; }
.stage-card-header.active { background: #fff; border-bottom-color: var(--yellow); border-bottom-width: 2px; }
.stage-card-header.pending { background: var(--grey-light); }
.stage-card-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.stage-card-body { padding: 18px; }
.stage-info-row { display: flex; gap: 12px; margin-bottom: 10px; font-size: 0.88rem; line-height: 1.4; }
.stage-info-row:last-child { margin-bottom: 0; }
.stage-info-label { font-weight: 700; color: var(--text-muted); min-width: 90px; flex-shrink: 0; font-size: 0.78rem; padding-top: 1px; }
.stage-info-issue .stage-info-label { padding-top: 0; }
.edit-stage-btn { background: none; border: 1px solid var(--grey-border); border-radius: 5px; padding: 3px 10px; font-size: 0.75rem; cursor: pointer; color: var(--text-muted); }
.edit-stage-btn:hover { border-color: var(--dark); color: var(--dark); }
.btn-stage-submit { width: 100%; padding: 14px; background: var(--dark); color: #fff; border: none; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 8px; font-family: inherit; }
.btn-stage-submit:hover { background: #333; }
.btn-stage-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-stage-complete { width: 100%; padding: 16px; background: #22c55e; color: #fff; border: none; border-radius: 10px; font-size: 1.05rem; font-weight: 700; cursor: pointer; margin-top: 8px; font-family: inherit; letter-spacing: 0.02em; }
.btn-stage-complete:hover { background: #16a34a; }
.btn-stage-complete:disabled { opacity: 0.5; cursor: not-allowed; }

/* FILTER BUTTONS */
.filter-btn { padding: 7px 16px; border: 1px solid var(--grey-border); border-radius: 20px; background: var(--white); color: var(--dark); font-size: 0.82rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.12s, border-color 0.12s; }
.filter-btn:hover { border-color: var(--dark); }
.filter-btn.active { background: var(--dark); color: #fff; border-color: var(--dark); }

/* JOB LIST + CARDS */
.job-list { display: flex; flex-direction: column; gap: 10px; }
.job-card { background: var(--card-bg); border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); cursor: pointer; border: 2px solid transparent; }
.job-card:hover { border-color: var(--yellow); }
.job-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.job-card-vehicle { font-weight: 700; font-size: 0.95rem; }
.job-card-issue { font-size: 0.88rem; color: var(--dark); margin-bottom: 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.job-card-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.76rem; color: var(--text-muted); }

/* STATUS BADGES */
.badge-requested { background: #fff3e0; color: #e65100; }
.badge-diagnosed { background: #e3f2fd; color: #1565c0; }
.badge-completed { background: #e8f5e9; color: #2e7d32; }

/* RESPONSIVE */
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .vehicle-grid { grid-template-columns: 1fr 1fr; }
    .work-order-card { flex-direction: column; }
    .work-order-actions { flex-direction: row; }
    .nav-user { display: none; }
    .modal { padding: 20px 16px; }
    .admin-table th:nth-child(2), .admin-table td:nth-child(2) { display: none; }
}
