/* YardDash App - Mobile-First PWA */
*{margin:0;padding:0;box-sizing:border-box}
:root{
  --green:#22c55e;--green2:#16a34a;--green-light:#dcfce7;--green-glow:rgba(34,197,94,0.12);
  --bg:#f5f7f5;--card:#fff;--dark:#0a1a0a;--text:#1a2e1a;--muted:#6b7b6b;
  --border:#e2e8e2;--danger:#ef4444;--blue:#3b82f6;--orange:#f59e0b;
  --radius:12px;--shadow:0 2px 12px rgba(0,0,0,0.06);
  --nav-height:56px;--tab-height:64px;
  --safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);
}
html,body{height:100%;overflow:hidden}
body{font-family:'Inter',sans-serif;background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}
#app{height:100%;display:flex;flex-direction:column}

/* SCROLLABLE CONTENT */
.screen{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-bottom:calc(var(--tab-height) + var(--safe-bottom) + 16px)}

/* TOP NAV */
.topnav{background:var(--card);border-bottom:1px solid var(--border);padding:12px 16px;padding-top:calc(12px + var(--safe-top));display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:50}
.topnav-title{font-size:18px;font-weight:800}
.topnav-title span{color:var(--green)}
.topnav-btn{background:none;border:none;font-size:22px;cursor:pointer;padding:4px}
.topnav-right{display:flex;gap:12px;align-items:center}

/* BOTTOM TABS */
.tabs{display:flex;background:var(--card);border-top:1px solid var(--border);padding-bottom:var(--safe-bottom);position:fixed;bottom:0;left:0;right:0;z-index:50}
.tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px 0;font-size:10px;font-weight:600;color:var(--muted);cursor:pointer;transition:color .2s;gap:2px;position:relative}
.tab.active{color:var(--green)}
.tab-icon{font-size:22px}
.tab-badge{position:absolute;top:4px;right:calc(50% - 18px);background:var(--danger);color:#fff;font-size:9px;font-weight:700;min-width:16px;height:16px;border-radius:8px;display:flex;align-items:center;justify-content:center;padding:0 4px}

/* CARDS */
.card{background:var(--card);border-radius:var(--radius);border:1px solid var(--border);padding:16px;margin:0 16px 12px;box-shadow:var(--shadow)}
.card-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:8px}
.card-title{font-size:16px;font-weight:700}
.card-meta{font-size:12px;color:var(--muted);display:flex;flex-direction:column;gap:4px;margin-bottom:12px}
.card-meta span{display:flex;align-items:center;gap:6px}
.card-price{font-size:24px;font-weight:800;color:var(--green2)}
.card-price small{font-size:12px;color:var(--muted);font-weight:400}
.card-footer{display:flex;gap:8px;margin-top:12px}
.card-tags{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}

/* TAGS */
.tag{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:600;padding:4px 10px;border-radius:6px}
.tag-green{background:var(--green-light);color:var(--green2)}
.tag-orange{background:#fef3c7;color:#b45309}
.tag-blue{background:#dbeafe;color:#1d4ed8}
.tag-red{background:#fee2e2;color:#991b1b}
.tag-gray{background:#f3f4f6;color:#6b7280}

/* BUTTONS */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:12px 20px;border-radius:var(--radius);font-size:14px;font-weight:700;border:none;cursor:pointer;transition:all .2s;font-family:'Inter',sans-serif;width:100%}
.btn-p{background:var(--green);color:#fff}
.btn-p:hover{background:var(--green2)}
.btn-p:active{transform:scale(0.98)}
.btn-s{background:var(--card);color:var(--text);border:1px solid var(--border)}
.btn-danger{background:var(--danger);color:#fff}
.btn-sm{padding:8px 14px;font-size:12px}
.btn-icon{width:auto;padding:8px 12px}
.btn:disabled{opacity:0.5;cursor:not-allowed}

/* INPUTS */
.form-group{margin-bottom:16px}
.form-label{display:block;font-size:13px;font-weight:600;margin-bottom:6px;color:var(--text)}
.form-input{width:100%;padding:12px 14px;border-radius:var(--radius);border:1px solid var(--border);font-size:14px;font-family:'Inter',sans-serif;background:var(--card);color:var(--text);transition:border .2s}
.form-input:focus{outline:none;border-color:var(--green);box-shadow:0 0 0 3px var(--green-glow)}
textarea.form-input{min-height:80px;resize:vertical}
select.form-input{appearance:none;background-image:url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7b6b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center;padding-right:40px}

/* HERO HEADER */
.hero-header{background:linear-gradient(135deg,var(--dark),#1a3a1a);color:#fff;padding:24px 16px;margin-bottom:16px;position:relative;overflow:hidden}
.hero-header::before{content:'';position:absolute;top:-50%;right:-30%;width:200px;height:200px;background:radial-gradient(circle,rgba(34,197,94,0.2),transparent 70%);border-radius:50%}
.hero-header h2{font-size:22px;font-weight:800;margin-bottom:4px;position:relative}
.hero-header p{font-size:13px;color:#aab6aa;position:relative}

/* SECTION */
.section-header{padding:0 16px;margin:20px 0 12px;display:flex;justify-content:space-between;align-items:center}
.section-title{font-size:16px;font-weight:700}
.section-link{font-size:13px;color:var(--green);font-weight:600;cursor:pointer;background:none;border:none;font-family:'Inter'}

/* EMPTY STATE */
.empty{text-align:center;padding:60px 20px}
.empty-icon{font-size:48px;margin-bottom:12px}
.empty h3{font-size:18px;font-weight:700;margin-bottom:6px}
.empty p{font-size:14px;color:var(--muted);margin-bottom:20px}

/* STATUS */
.status-dot{width:8px;height:8px;border-radius:50%;display:inline-block}
.status-open{background:var(--green)}
.status-active{background:var(--blue)}
.status-pending{background:var(--orange)}
.status-done{background:#9ca3af}

/* AVATAR */
.avatar{width:40px;height:40px;border-radius:50%;background:var(--green-light);display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;color:var(--green2);flex-shrink:0}
.avatar-lg{width:64px;height:64px;font-size:28px}

/* STAR RATING */
.stars{color:#f59e0b;font-size:14px;letter-spacing:2px}

/* MODAL / OVERLAY */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.4);z-index:100;display:flex;align-items:flex-end;justify-content:center}
.modal{background:var(--card);border-radius:20px 20px 0 0;width:100%;max-width:500px;max-height:85vh;overflow-y:auto;padding:24px 16px;padding-bottom:calc(24px + var(--safe-bottom))}
.modal-handle{width:40px;height:4px;background:var(--border);border-radius:2px;margin:0 auto 16px}
.modal h3{font-size:20px;font-weight:800;margin-bottom:16px}

/* SEARCH */
.search-bar{margin:0 16px 16px;position:relative}
.search-bar input{width:100%;padding:12px 14px 12px 40px;border-radius:var(--radius);border:1px solid var(--border);font-size:14px;font-family:'Inter',sans-serif;background:var(--card)}
.search-bar input:focus{outline:none;border-color:var(--green)}
.search-bar::before{content:'🔍';position:absolute;left:14px;top:50%;transform:translateY(-50%);font-size:14px}

/* FILTERS */
.filter-row{display:flex;gap:8px;padding:0 16px;margin-bottom:16px;overflow-x:auto;-webkit-overflow-scrolling:touch}
.filter-row::-webkit-scrollbar{display:none}
.filter-chip{white-space:nowrap;padding:8px 14px;border-radius:20px;font-size:12px;font-weight:600;background:var(--card);border:1px solid var(--border);cursor:pointer;flex-shrink:0}
.filter-chip.active{background:var(--green);color:#fff;border-color:var(--green)}

/* PROFILE ROW */
.profile-row{display:flex;align-items:center;gap:12px;padding:16px;background:var(--card);border-bottom:1px solid var(--border)}
.profile-info{flex:1}
.profile-info h4{font-size:14px;font-weight:700}
.profile-info p{font-size:12px;color:var(--muted)}

/* JOB DETAIL */
.job-photos{display:flex;gap:8px;overflow-x:auto;padding:0 16px;margin-bottom:16px;-webkit-overflow-scrolling:touch}
.job-photo{width:120px;height:120px;border-radius:12px;background:#e8ede8;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:32px}

/* MAP PLACEHOLDER */
.map-placeholder{background:linear-gradient(135deg,#e8ede8,#d4ddd4);border-radius:var(--radius);height:160px;margin:0 16px 16px;display:flex;align-items:center;justify-content:center;font-size:14px;color:var(--muted);font-weight:600}

/* NOTIFICATION */
.notif{display:flex;align-items:flex-start;gap:12px;padding:14px 16px;border-bottom:1px solid var(--border);background:var(--card)}
.notif.unread{background:#f0fdf4}
.notif-icon{font-size:24px;flex-shrink:0;margin-top:2px}
.notif-content{flex:1}
.notif-content h4{font-size:14px;font-weight:600;margin-bottom:2px}
.notif-content p{font-size:12px;color:var(--muted)}
.notif-time{font-size:11px;color:var(--muted);flex-shrink:0}

/* EARNINGS */
.earnings-card{background:linear-gradient(135deg,var(--dark),#1a3a1a);color:#fff;border-radius:var(--radius);padding:24px;margin:0 16px 16px;position:relative;overflow:hidden}
.earnings-card::before{content:'';position:absolute;top:-30%;right:-20%;width:150px;height:150px;background:radial-gradient(circle,rgba(34,197,94,0.2),transparent 70%);border-radius:50%}
.earnings-label{font-size:12px;color:#aab6aa;margin-bottom:4px;position:relative}
.earnings-amount{font-size:36px;font-weight:900;position:relative}
.earnings-sub{font-size:13px;color:#6b8b6b;margin-top:4px;position:relative}

/* AUTH SCREEN */
.auth-screen{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;padding:40px 24px;text-align:center;background:var(--bg)}
.auth-logo{font-size:32px;font-weight:900;margin-bottom:8px}
.auth-logo span{color:var(--green)}
.auth-sub{color:var(--muted);font-size:14px;margin-bottom:32px}
.auth-form{width:100%;max-width:360px}
.auth-toggle{margin-top:16px;font-size:13px;color:var(--muted)}
.auth-toggle a{color:var(--green);font-weight:600;cursor:pointer}
.auth-divider{display:flex;align-items:center;gap:12px;margin:20px 0;color:var(--muted);font-size:12px}
.auth-divider::before,.auth-divider::after{content:'';flex:1;height:1px;background:var(--border)}
.role-select{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:20px}
.role-card{border:2px solid var(--border);border-radius:var(--radius);padding:20px 16px;text-align:center;cursor:pointer;transition:all .2s}
.role-card.selected{border-color:var(--green);background:var(--green-light)}
.role-card .icon{font-size:32px;margin-bottom:8px}
.role-card h4{font-size:14px;font-weight:700}
.role-card p{font-size:11px;color:var(--muted)}

/* ANIMATIONS */
@keyframes slideUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
.modal{animation:slideUp .3s ease-out}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.modal-overlay{animation:fadeIn .2s ease-out}

/* RESPONSIVE */
@media(min-width:500px){
  #app{max-width:430px;margin:0 auto;box-shadow:0 0 40px rgba(0,0,0,0.1);border-left:1px solid var(--border);border-right:1px solid var(--border)}
}
</style>