*{box-sizing:border-box;margin:0;padding:0;}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#f5f6fa;color:#222;}
a{text-decoration:none;color:#ff6b4a;}

/* NAVBAR */
.navbar{display:flex;justify-content:space-between;align-items:center;padding:14px 24px;background:#fff;border-bottom:1px solid #eee;flex-wrap:wrap;gap:10px;position:sticky;top:0;z-index:100;}
.navbar-brand{font-size:20px;font-weight:700;color:#ff6b4a;}
.navbar-links{display:flex;align-items:center;gap:18px;font-size:14px;flex-wrap:wrap;}
.navbar-links a{color:#444;font-weight:500;}
.navbar-user{color:#888;}
.navbar-logout{color:#ff4757!important;}

/* AUTH */
.auth-page{display:flex;align-items:center;justify-content:center;min-height:100vh;}
.auth-box{background:#fff;padding:36px;border-radius:16px;width:100%;max-width:420px;box-shadow:0 10px 30px rgba(0,0,0,.08);}
.auth-box h1{font-size:24px;margin-bottom:4px;}
.subtitle{color:#888;margin-bottom:20px;font-size:14px;}

/* FORMS */
.form-row{display:flex;gap:12px;}
.form-group{margin-bottom:16px;flex:1;}
.form-group label{display:block;font-size:13px;font-weight:600;margin-bottom:6px;color:#555;}
.form-group input,.form-group select,.form-group textarea{width:100%;padding:11px 14px;border:1px solid #ddd;border-radius:8px;font-size:14px;font-family:inherit;}
.form-group textarea{resize:vertical;}

/* BUTTONS */
.btn{display:inline-block;padding:11px 20px;border-radius:8px;border:none;font-weight:600;cursor:pointer;font-size:14px;text-align:center;transition:.2s;}
.btn-primary{background:#ff6b4a;color:#fff;}
.btn-primary:hover{background:#e55a3a;}
.btn-secondary{background:#eee;color:#333;}
.btn-danger{background:#ff4757;color:#fff;}
.btn-success{background:#2ed573;color:#fff;}
.btn-full{width:100%;display:block;}
.btn-sm{padding:6px 12px;font-size:12px;}

/* ALERTS */
.alert{padding:10px 14px;border-radius:8px;font-size:13px;margin-bottom:16px;}
.alert-error{background:#ffe3e3;color:#c0392b;}
.alert-success{background:#e3ffe9;color:#218c4a;}
.auth-switch{margin-top:18px;font-size:14px;text-align:center;color:#666;}

/* LAYOUT */
.page-container{max-width:1100px;margin:0 auto;padding:24px;}
.page-title{font-size:24px;margin-bottom:20px;}
.card-box{background:#fff;border-radius:14px;padding:20px;margin-bottom:16px;box-shadow:0 2px 8px rgba(0,0,0,.05);}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;}

/* TABS */
.tabs{display:flex;gap:8px;margin-bottom:20px;border-bottom:1px solid #ddd;overflow-x:auto;}
.tab{padding:10px 18px;cursor:pointer;font-weight:600;color:#888;border-bottom:3px solid transparent;white-space:nowrap;}
.tab.active{color:#ff6b4a;border-color:#ff6b4a;}

/* TABLE */
.table{width:100%;border-collapse:collapse;background:#fff;border-radius:12px;overflow:hidden;}
.table th,.table td{padding:12px 14px;text-align:left;border-bottom:1px solid #f0f0f0;font-size:14px;}
.table th{background:#fafafa;font-weight:700;color:#555;}

/* BADGES & STATUS */
.badge{display:inline-block;padding:4px 10px;border-radius:20px;font-size:11px;font-weight:700;}
.badge-urgente{background:#ff4757;color:#fff;}
.badge-medio{background:#ffa502;color:#fff;}
.badge-normale{background:#2ed573;color:#fff;}
.badge-categoria{background:rgba(0,0,0,.6);color:#fff;}
.status-pill{padding:3px 10px;border-radius:20px;font-size:11px;font-weight:700;display:inline-block;}
.status-in_attesa,.status-in_corso{background:#fff3cd;color:#92750a;}
.status-approvato,.status-attivo,.status-completato{background:#d4f7dc;color:#18793b;}
.status-rifiutato,.status-bannato{background:#fde2e2;color:#b91c1c;}
.status-sospeso{background:#fff3cd;color:#92750a;}
.status-annullato{background:#eee;color:#888;}
.icon-btn{background:none;border:none;cursor:pointer;font-size:14px;color:#ff6b4a;font-weight:600;}

/* SWIPE STACK */
.swipe-container{max-width:420px;margin:0 auto;padding:20px;text-align:center;}
.swipe-title{font-size:20px;margin-bottom:16px;}
.card-stack{position:relative;height:580px;}
.job-card{position:absolute;top:0;left:0;width:100%;height:100%;background:#fff;border-radius:18px;overflow:hidden;box-shadow:0 8px 24px rgba(0,0,0,.15);cursor:grab;user-select:none;display:flex;flex-direction:column;}
.job-card:active{cursor:grabbing;}
.job-card-photo{position:relative;height:230px;background:#ddd;flex-shrink:0;}
.job-card-photo img{width:100%;height:100%;object-fit:cover;}
.job-card-photo-placeholder{display:flex;align-items:center;justify-content:center;height:100%;font-size:60px;background:linear-gradient(135deg,#f5f6fa,#e8e9f3);}
.job-card-badges{position:absolute;top:12px;left:12px;right:12px;display:flex;justify-content:space-between;}
.job-card-body{padding:16px;overflow-y:auto;text-align:left;flex:1;}
.job-card-body h2{font-size:18px;margin-bottom:6px;}
.job-reward{font-size:18px;font-weight:700;color:#218c4a;margin-bottom:8px;}
.job-desc{font-size:13px;color:#444;margin-bottom:10px;line-height:1.5;}
.job-location{font-size:13px;color:#777;margin-bottom:8px;}
.job-equip{font-size:13px;background:#f5f6fa;padding:8px 10px;border-radius:8px;margin-bottom:8px;}
.job-author{font-size:12px;color:#999;}
.swipe-like{box-shadow:0 0 0 5px #2ed573 inset;}
.swipe-nope{box-shadow:0 0 0 5px #ff4757 inset;}
.swipe-label{position:absolute;top:20px;font-size:28px;font-weight:900;padding:8px 18px;border-radius:10px;border:4px solid;opacity:0;transition:.1s;}
.swipe-label-yes{left:20px;color:#2ed573;border-color:#2ed573;transform:rotate(-15deg);}
.swipe-label-no{right:20px;color:#ff4757;border-color:#ff4757;transform:rotate(15deg);}
.swipe-actions{display:flex;justify-content:center;gap:30px;margin-top:20px;}
.swipe-btn{width:64px;height:64px;border-radius:50%;border:none;font-size:28px;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.12);transition:.2s;}
.swipe-btn:hover{transform:scale(1.1);}
.swipe-btn-no{background:#fff;color:#ff4757;}
.swipe-btn-yes{background:#fff;color:#2ed573;}
.empty-state{padding:60px 20px;color:#888;text-align:center;}
.match-toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);background:#222;color:#fff;padding:12px 24px;border-radius:30px;font-size:14px;z-index:999;animation:fadeUp .3s ease;}
@keyframes fadeUp{from{opacity:0;transform:translate(-50%,20px)}to{opacity:1;transform:translate(-50%,0)}}

/* CHAT */
.chat-layout{display:flex;height:calc(100vh - 60px);}
.chat-sidebar{width:300px;border-right:1px solid #eee;background:#fff;overflow-y:auto;flex-shrink:0;}
.chat-sidebar-title{padding:16px;font-weight:700;font-size:15px;border-bottom:1px solid #eee;}
.chat-item{display:flex;gap:10px;padding:14px 16px;cursor:pointer;border-bottom:1px solid #f5f5f5;transition:.15s;}
.chat-item:hover,.chat-item.active{background:#fff5f3;}
.chat-item-avatar{width:42px;height:42px;border-radius:50%;background:#ff6b4a;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:16px;flex-shrink:0;}
.chat-item-info{flex:1;min-width:0;}
.chat-item-name{font-weight:600;font-size:14px;}
.chat-item-job{font-size:12px;color:#888;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.chat-item-time{font-size:11px;color:#aaa;}
.chat-unread{background:#ff6b4a;color:#fff;border-radius:50%;width:18px;height:18px;font-size:10px;font-weight:700;display:flex;align-items:center;justify-content:center;}
.chat-main{flex:1;display:flex;flex-direction:column;min-width:0;}
.chat-header{padding:14px 18px;background:#fff;border-bottom:1px solid #eee;display:flex;align-items:center;gap:12px;}
.chat-header-info h3{font-size:15px;}
.chat-header-info p{font-size:12px;color:#888;}
.chat-messages{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px;}
.msg{max-width:72%;display:flex;flex-direction:column;}
.msg-me{align-self:flex-end;align-items:flex-end;}
.msg-other{align-self:flex-start;align-items:flex-start;}
.msg-bubble{padding:10px 14px;border-radius:18px;font-size:14px;line-height:1.4;word-break:break-word;}
.msg-me .msg-bubble{background:#ff6b4a;color:#fff;border-bottom-right-radius:4px;}
.msg-other .msg-bubble{background:#f0f0f0;color:#222;border-bottom-left-radius:4px;}
.msg-time{font-size:10px;color:#aaa;margin-top:2px;}
.chat-input-area{padding:12px 16px;background:#fff;border-top:1px solid #eee;display:flex;gap:10px;align-items:flex-end;}
.chat-input-area textarea{flex:1;padding:10px 14px;border:1px solid #ddd;border-radius:22px;font-size:14px;resize:none;max-height:100px;font-family:inherit;}
.chat-send-btn{background:#ff6b4a;color:#fff;border:none;border-radius:50%;width:42px;height:42px;font-size:20px;cursor:pointer;flex-shrink:0;}
.chat-actions{padding:10px 16px;background:#fff8f6;border-top:1px solid #f0e0da;display:flex;gap:10px;flex-wrap:wrap;}
.chat-empty{display:flex;align-items:center;justify-content:center;height:100%;color:#888;flex-direction:column;gap:8px;}

/* RECENSIONI e FOTO FINE LAVORO */
.stars{color:#f0a500;font-size:20px;letter-spacing:2px;}
.stars-input label{font-size:28px;cursor:pointer;color:#ddd;}
.stars-input input:checked ~ label,.stars-input label:hover,.stars-input label:hover ~ label{color:#f0a500;}
.stars-input{display:flex;flex-direction:row-reverse;justify-content:flex-end;}
.review-card{border:1px solid #f0f0f0;border-radius:12px;padding:14px;margin-bottom:12px;}
.photo-thumb{width:80px;height:80px;object-fit:cover;border-radius:8px;margin-right:6px;}
.photo-grid{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;}

/* VERIFICA ETÀ */
.verify-step{background:#fff3f0;border:2px dashed #ff6b4a;border-radius:14px;padding:24px;text-align:center;}
.verify-step h3{margin-bottom:8px;color:#ff6b4a;}

/* PROFILO */
.profile-avatar{width:80px;height:80px;border-radius:50%;object-fit:cover;border:3px solid #ff6b4a;}
.profile-initials{width:80px;height:80px;border-radius:50%;background:#ff6b4a;display:flex;align-items:center;justify-content:center;color:#fff;font-size:28px;font-weight:700;}

/* PWA Install Banner */
#pwa-install-banner{display:none;position:fixed;bottom:0;left:0;right:0;background:#ff6b4a;color:#fff;padding:14px 20px;z-index:200;align-items:center;justify-content:space-between;gap:12px;}
#pwa-install-banner.show{display:flex;}
#pwa-install-banner button{background:#fff;color:#ff6b4a;border:none;padding:8px 16px;border-radius:8px;font-weight:700;cursor:pointer;}
#pwa-install-banner .close-banner{background:none;color:#fff;font-size:20px;padding:4px 8px;}

.checkbox-list{display:flex;flex-wrap:wrap;gap:10px;}
.checkbox-list label{display:flex;align-items:center;gap:6px;background:#f5f6fa;padding:6px 12px;border-radius:8px;font-size:13px;cursor:pointer;}

@media(max-width:700px){
.grid-2,.grid-4{grid-template-columns:1fr;}
.form-row{flex-direction:column;}
.chat-sidebar{width:100%;height:200px;}
.chat-layout{flex-direction:column;}
}
