/* ═══ ADD TASK FLOW ═══ */

/* --- Task Menu Overlay --- */
.atf-menu-ov{position:fixed;inset:0;z-index:var(--z-overlay);display:none}
.atf-menu-ov.active{display:block}
.atf-menu-panel{position:fixed;background:#fff;border-radius:16px;box-shadow:0 12px 40px rgba(0,0,0,.12),0 0 0 1px #e5e7eb;padding:6px;width:260px}
[data-theme="dark"] .atf-menu-panel{background:#1e293b;box-shadow:0 12px 40px rgba(0,0,0,.4),0 0 0 1px #334155}
.atf-menu-label{padding:8px 14px 10px;font-size:12px;font-weight:600;color:#9ca3af;font-style:italic}

/* --- Task type buttons --- */
.ntb{display:flex;align-items:center;gap:0;cursor:pointer;transition:all .25s;width:100%;overflow:hidden;position:relative;font-family:inherit;margin-bottom:6px;border:none;text-align:left}
.ntb:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.08)}
.ntb-icon{width:42px;display:flex;align-items:center;justify-content:center;align-self:stretch;flex-shrink:0}
.ntb-body{flex:1;padding:10px 14px;display:flex;flex-direction:column;gap:1px}
.ntb-label{font-size:12px;font-weight:800}
.ntb-sub{font-size:9px;font-weight:600;opacity:.6;font-family:'JetBrains Mono',monospace;letter-spacing:.5px}

.ntb-pull{background:linear-gradient(rgba(200,215,235,.2) 1px,transparent 1px),linear-gradient(90deg,rgba(200,215,235,.2) 1px,transparent 1px),#f8fafd;background-size:12px 12px;border:2px solid #c5d3e8;border-radius:4px;box-shadow:0 1px 4px rgba(0,0,0,.04)}
.ntb-pull .ntb-icon{background:rgba(59,130,246,.08);color:#3b82f6;border-right:2px solid #c5d3e8}
.ntb-pull .ntb-label{color:#1a2a42}.ntb-pull .ntb-sub{color:#8ba4c8}

.ntb-repair{background:#fff;border-radius:14px;box-shadow:0 1px 3px rgba(0,0,0,.04),0 0 0 1px rgba(0,0,0,.03);border:none}
.ntb-repair .ntb-icon{background:linear-gradient(180deg,#16a34a,#22c55e);color:#fff;border-radius:14px 0 0 14px}
.ntb-repair .ntb-label{color:#0f172a}.ntb-repair .ntb-sub{color:#16a34a}

.ntb-listings{background:repeating-linear-gradient(135deg,transparent,transparent 14px,rgba(139,92,246,.03) 14px,rgba(139,92,246,.03) 15px),#faf9fd;border:2px solid #c4b5d8;border-radius:6px;box-shadow:0 2px 6px rgba(0,0,0,.04)}
.ntb-listings .ntb-icon{background:repeating-linear-gradient(0deg,#7c3aed,#7c3aed 3px,#6d28d9 3px,#6d28d9 6px);color:#e9d5ff;border-radius:4px 0 0 4px}
.ntb-listings .ntb-label{color:#3b1d6e}.ntb-listings .ntb-sub{color:#a78bfa}

.ntb-message{background:#f8fffe;border:1px solid #a7f3d0;border-radius:10px;border-left:4px solid #0d9488;box-shadow:0 1px 3px rgba(0,0,0,.03)}
.ntb-message .ntb-icon{background:rgba(13,148,136,.08);color:#0d9488}
.ntb-message .ntb-label{color:#0f172a}.ntb-message .ntb-sub{color:#0d9488}

.ntb-checkin{background:#fafafa;border:2px solid #d4d4d4;border-top:4px solid #dc2626;border-radius:3px;box-shadow:0 2px 6px rgba(0,0,0,.06)}
.ntb-checkin .ntb-icon{background:#292524;color:#fca5a5;border-radius:1px 0 0 1px}
.ntb-checkin .ntb-label{color:#292524;font-family:'JetBrains Mono',monospace;letter-spacing:-.5px}.ntb-checkin .ntb-sub{color:#dc2626}

.ntb-other{background:#fffef9;border:1.5px dashed #d4c9a8;border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,.03)}
.ntb-other .ntb-icon{background:transparent;color:#8b7a4a;border-right:1.5px dashed #d4c9a8}
.ntb-other .ntb-label{color:#3d3520;font-family:'Caveat',cursive;font-size:15px}.ntb-other .ntb-sub{color:#b8a880}

/* --- Dark mode menu buttons --- */
[data-theme="dark"] .ntb-pull{background:#1a2536;border-color:#2d4a6f}
[data-theme="dark"] .ntb-pull .ntb-icon{background:rgba(59,130,246,.15);border-color:#2d4a6f}
[data-theme="dark"] .ntb-pull .ntb-label{color:#93c5fd}
[data-theme="dark"] .ntb-repair{background:#1e293b;box-shadow:0 1px 3px rgba(0,0,0,.2)}
[data-theme="dark"] .ntb-repair .ntb-label{color:#e2e8f0}
[data-theme="dark"] .ntb-listings{background:#1e1a2e;border-color:#4c3d7a}
[data-theme="dark"] .ntb-listings .ntb-label{color:#c4b5fd}
[data-theme="dark"] .ntb-message{background:#0f2a2a;border-color:#134e4a}
[data-theme="dark"] .ntb-message .ntb-label{color:#e2e8f0}
[data-theme="dark"] .ntb-checkin{background:#1a1a1a;border-color:#404040}
[data-theme="dark"] .ntb-checkin .ntb-label{color:#e2e8f0}
[data-theme="dark"] .ntb-other{background:#1a1810;border-color:#4a4530}
[data-theme="dark"] .ntb-other .ntb-label{color:#d4c9a8}

/* --- Flow Overlay --- */
.atf-ov{position:fixed;inset:0;z-index:var(--z-modal);background:rgba(0,0,0,.35);backdrop-filter:blur(6px);display:none}
.atf-ov.active{display:flex;align-items:center;justify-content:center}
.atf-pop{position:absolute;inset:16px 30px;background:#f4f5f7;border-radius:20px;box-shadow:0 25px 80px rgba(0,0,0,.3);display:flex;flex-direction:column;overflow:hidden}
[data-theme="dark"] .atf-pop{background:#0f172a}
@media(max-width:768px){.atf-pop{inset:0;border-radius:0}}

/* --- Flow header --- */
.atf-fh{background:#fff;border-bottom:1px solid #e5e7eb;flex-shrink:0}
[data-theme="dark"] .atf-fh{background:#1e293b;border-color:#334155}
.atf-fh-top{padding:12px 24px;display:flex;align-items:center;gap:12px}
@media(max-width:768px){.atf-fh-top{padding:10px 16px}}
.atf-fh-icon{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0}
.atf-fh-title{flex:1}
.atf-fh-title h2{font-size:18px;font-weight:800}
.atf-fh-title p{font-size:12px;color:#94a3b8;margin-top:1px}
.atf-fb{width:38px;height:38px;border-radius:10px;background:#f3f4f6;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:20px;color:#64748b}
.atf-fb:hover{background:#e5e7eb}
[data-theme="dark"] .atf-fb{background:#334155;color:#94a3b8}
[data-theme="dark"] .atf-fb:hover{background:#475569}

/* --- Steps indicator --- */
.atf-si{display:flex;align-items:center;padding:0 24px 12px}
.atf-si-dot{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;background:#e5e7eb;color:#94a3b8;transition:all .2s}
[data-theme="dark"] .atf-si-dot{background:#334155;color:#64748b}
.atf-si-label{font-size:12px;font-weight:500;color:#94a3b8;white-space:nowrap;margin-left:6px}
.atf-si-label.on{font-weight:700;color:#0f172a}
[data-theme="dark"] .atf-si-label.on{color:#e2e8f0}
.atf-si-line{flex:1;height:2px;border-radius:1px;background:#e5e7eb;margin:0 10px}
[data-theme="dark"] .atf-si-line{background:#334155}

/* --- Flow body --- */
.atf-body{flex:1;overflow:auto;-webkit-overflow-scrolling:touch}
.atf-body.white{background:#fff}
[data-theme="dark"] .atf-body.white{background:#1e293b}
.atf-foot{padding:10px 20px;border-top:1px solid #e2e8f0;background:#fff;flex-shrink:0}
[data-theme="dark"] .atf-foot{background:#1e293b;border-color:#334155}

/* --- Vehicle grid --- */
.atf-vgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px}
@media(max-width:768px){.atf-vgrid{grid-template-columns:1fr;gap:10px}}
.atf-vcard{background:#fff;border:1px solid #e5e7eb;border-radius:14px;overflow:hidden;cursor:pointer;transition:all .15s;display:flex;flex-direction:column;text-align:left;font-family:inherit;padding:0}
.atf-vcard:hover{border-color:#94a3b8;box-shadow:0 6px 20px rgba(0,0,0,.06);transform:translateY(-2px)}
[data-theme="dark"] .atf-vcard{background:#1e293b;border-color:#334155}
[data-theme="dark"] .atf-vcard:hover{border-color:#64748b}
.atf-vphoto{position:relative;height:120px;overflow:hidden;border-radius:14px 14px 0 0}
.atf-vphoto .sil{width:100%;height:100%;display:flex;align-items:center;justify-content:center}
.atf-vphoto .sil svg{opacity:.25}
.atf-vphoto .pbadge{position:absolute;bottom:8px;left:8px;color:#fff;font-size:11px;font-weight:700;padding:3px 10px;border-radius:6px}
.atf-vinfo{padding:12px 14px 14px}
.atf-vinfo h3{font-size:16px;font-weight:800;line-height:1.3;margin-bottom:2px}
.atf-vinfo .sub{font-size:12px;color:#94a3b8;margin-bottom:8px}
.atf-vspec{display:flex;justify-content:space-between;padding:5px 0;border-top:1px solid #f5f5f5;font-size:12px}
[data-theme="dark"] .atf-vspec{border-color:#334155}
.atf-vspec .l{color:#64748b}.atf-vspec .v{font-weight:700}
.atf-vbadges{display:flex;gap:6px;margin-top:10px}
.atf-badge{font-size:10px;font-weight:800;padding:3px 8px;border-radius:4px;text-transform:uppercase}
.atf-b-listed{background:#0f172a;color:#fff}
.atf-b-active{background:#16a34a;color:#fff}
.atf-b-partout{background:#fef2f2;color:#dc2626}
.atf-b-new{background:#eff6ff;color:#2563eb}
.atf-vadd{background:#fafbfc;border:2px dashed #d1d5db;border-radius:14px;min-height:180px;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;transition:all .15s;padding:0}
.atf-vadd:hover{border-color:#3b82f6;background:#eff6ff}
[data-theme="dark"] .atf-vadd{background:#0f172a;border-color:#475569}
[data-theme="dark"] .atf-vadd:hover{border-color:#3b82f6;background:#1e293b}

/* --- Search --- */
.atf-swrap{position:relative;margin-bottom:16px}
.atf-swrap .ico{position:absolute;left:14px;top:50%;transform:translateY(-50%);font-size:15px;color:#94a3b8;pointer-events:none}
.atf-sinput{width:100%;padding:13px 16px 13px 42px;border:1.5px solid #e2e8f0;border-radius:12px;font-size:15px;font-family:inherit;color:#0f172a;outline:none;background:#fff}
.atf-sinput:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.08)}
[data-theme="dark"] .atf-sinput{background:#0f172a;border-color:#334155;color:#e2e8f0}

/* --- Parts selection --- */
.atf-ph{padding:10px 20px;background:#f8fafc;border-bottom:1px solid #e5e7eb;flex-shrink:0}
[data-theme="dark"] .atf-ph{background:#0f172a;border-color:#334155}
.atf-pstrip{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.atf-pthumb{width:48px;height:32px;border-radius:6px;overflow:hidden;flex-shrink:0}
.atf-pcontrols{display:flex;gap:8px;align-items:center}
.atf-vtoggle{display:flex;background:#e5e7eb;border-radius:8px;padding:2px}
[data-theme="dark"] .atf-vtoggle{background:#334155}
.atf-vtoggle button{padding:6px 10px;border-radius:6px;border:none;font-size:13px;cursor:pointer;background:transparent;color:#94a3b8;font-weight:700}
.atf-vtoggle button.on{background:#fff;color:#0f172a}
[data-theme="dark"] .atf-vtoggle button.on{background:#475569;color:#e2e8f0}

.atf-prow{display:flex;align-items:center;gap:14px;padding:13px 20px;border-bottom:1px solid #f5f5f5;cursor:pointer;background:#fff;transition:background .1s}
.atf-prow:hover{background:#f8fafc}
[data-theme="dark"] .atf-prow{background:#1e293b;border-color:#334155}
[data-theme="dark"] .atf-prow:hover{background:#253344}
.atf-pcb{width:22px;height:22px;border-radius:6px;flex-shrink:0;border:2px solid #d1d5db;background:#fff;display:flex;align-items:center;justify-content:center;transition:all .15s}
[data-theme="dark"] .atf-pcb{border-color:#475569;background:#0f172a}
.atf-pcb .ck{color:#fff;font-size:13px;font-weight:800;display:none}
.atf-prow.on .atf-pcb .ck{display:block}
.atf-pname{flex:1;font-size:15px;font-weight:500}
.atf-pstatus{font-size:12px;color:#94a3b8;font-style:italic;flex-shrink:0}

.atf-pgrid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;padding:12px 16px}
@media(max-width:768px){.atf-pgrid{grid-template-columns:1fr 1fr}}

/* --- Review section --- */
.atf-rsection{max-width:600px;margin:0 auto;padding:24px}
@media(max-width:768px){.atf-rsection{padding:16px 14px}}
.atf-rcard{background:#fff;border-radius:14px;border:1px solid #e5e7eb;margin-bottom:16px;overflow:hidden}
[data-theme="dark"] .atf-rcard{background:#1e293b;border-color:#334155}
.atf-rcard-b{padding:14px 16px}
.atf-rcard h3{font-size:14px;font-weight:800;margin-bottom:12px}
.atf-chips{display:flex;flex-wrap:wrap;gap:6px}
.atf-chip{display:flex;align-items:center;gap:5px;padding:5px 10px;border-radius:8px;font-size:12px;font-weight:600}
.atf-chip .rm{background:none;border:none;cursor:pointer;color:#94a3b8;font-size:14px;padding:0;margin-left:2px}
.atf-pills{display:flex;gap:6px;flex-wrap:wrap}
.atf-pill{padding:8px 14px;border-radius:8px;font-size:13px;font-weight:700;cursor:pointer;background:#f8fafc;color:#64748b;border:1.5px solid #e2e8f0;font-family:inherit;transition:all .12s}
.atf-pill.on{background:#0f172a;color:#fff;border-color:#0f172a}
[data-theme="dark"] .atf-pill{background:#0f172a;border-color:#334155;color:#94a3b8}
[data-theme="dark"] .atf-pill.on{background:#3b82f6;border-color:#3b82f6;color:#fff}

.atf-flabel{font-size:11px;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px;display:block}
.atf-finput{width:100%;padding:10px 12px;border:1.5px solid #e2e8f0;border-radius:10px;font-size:14px;font-family:inherit;color:#0f172a;outline:none;background:#f8fafc}
.atf-finput:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.08)}
[data-theme="dark"] .atf-finput{background:#0f172a;border-color:#334155;color:#e2e8f0}
textarea.atf-finput{resize:vertical;min-height:80px}
.atf-frow{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.atf-fgroup{margin-bottom:12px}

.atf-btn-cont{width:100%;padding:13px;border-radius:12px;border:none;font-size:15px;font-weight:800;font-family:inherit;cursor:pointer;background:#0f172a;color:#fff}
.atf-btn-cont:disabled{background:#e2e8f0;color:#94a3b8;cursor:default}
[data-theme="dark"] .atf-btn-cont:disabled{background:#334155;color:#64748b}
.atf-btn-create{width:100%;padding:16px;border-radius:14px;border:none;font-size:17px;font-weight:800;font-family:inherit;cursor:pointer;color:#fff;margin-bottom:20px}

/* --- Exit dialog --- */
.atf-ex-ov{position:absolute;inset:0;background:rgba(0,0,0,.25);z-index:20;display:none;align-items:center;justify-content:center;backdrop-filter:blur(2px)}
.atf-ex-ov.active{display:flex}
.atf-ex-dlg{background:#fff;border-radius:16px;width:400px;padding:24px;box-shadow:0 20px 50px rgba(0,0,0,.12);text-align:center}
[data-theme="dark"] .atf-ex-dlg{background:#1e293b}
@media(max-width:768px){.atf-ex-dlg{width:100%;border-radius:18px 18px 0 0}.atf-ex-ov.active{align-items:flex-end}}
.atf-ex-dlg h3{font-size:18px;font-weight:800;margin-bottom:6px}
.atf-ex-dlg p{font-size:14px;color:#64748b;line-height:1.4;margin-bottom:20px}
.atf-ex-acts{display:flex;gap:8px}
.atf-ex-acts button{flex:1;padding:12px;border-radius:10px;font-size:14px;cursor:pointer;font-family:inherit}
.atf-ex-acts .keep{background:#f8fafc;border:1px solid #e2e8f0;color:#64748b;font-weight:600}
.atf-ex-acts .save{background:#0f172a;border:none;color:#fff;font-weight:700}
.atf-ex-acts .disc{background:#fef2f2;border:1px solid #fecaca;color:#dc2626;font-weight:700}
