*{box-sizing:border-box}
body{margin:0;background:#f5f6f8;color:#292929;font-family:Arial,Helvetica,sans-serif;line-height:1.55}
.wrap{width:min(1180px,calc(100% - 28px));margin:auto}
.public{max-width:900px}
.top{padding:18px 0;background:#1d1d1d;color:#fff;font-size:24px;font-weight:800}
.top span{font-size:16px;font-weight:400;opacity:.75}
.hero{margin:28px 0;padding:48px 32px;text-align:center;color:#fff;background:linear-gradient(135deg,#730006,#a81218 60%,#ca3036);border-radius:11px}
.hero h1{margin:5px 0 12px;font-size:clamp(31px,5vw,47px)}
.hero p{max-width:760px;margin:auto;font-size:18px}
.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:13px;font-weight:bold}
.redtext{color:#a81218}

.cards{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}
.card{padding:28px;background:#fff;border:1px solid #dde1e6;border-top:5px solid #a81218;border-radius:9px;color:#292929;text-decoration:none}
.card.disabled{opacity:.55;border-top-color:#888}
.card h2{color:#811015}

.panel,.notice{padding:28px;background:#fff;border:1px solid #dde1e6;border-radius:9px;margin:22px 0}
.login{max-width:480px;margin:60px auto}
.admin-title{display:flex;justify-content:space-between;align-items:center;margin:34px 0 20px;gap:20px}
.admin-title h1{margin:4px 0;font-size:38px}

.grid,.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
label{display:block;margin-bottom:17px;font-weight:bold}
input,textarea,select{display:block;width:100%;margin-top:6px;padding:12px;border:1px solid #aab2bd;border-radius:5px;background:#fff;font:inherit}
.check{display:flex;gap:9px;font-weight:normal}
.check input{width:auto;margin-top:5px}
.hidden{position:absolute;left:-10000px}
.warning{margin:18px 0;padding:14px;background:#fff5df;border-left:5px solid #d68a00}
.success{border-left:6px solid #398547}
.error{border-left:6px solid #a81218}
.text-error{color:#a81218;font-weight:bold}
.help{color:#666;margin-top:-5px}

.primary-button,.btn,.action-card,button{cursor:pointer!important;transition:filter .15s ease,transform .15s ease,box-shadow .15s ease}
.primary-button{width:100%;padding:15px;border:0;border-radius:6px;background:#a81218;color:#fff;font-size:18px;font-weight:bold}
.btn{display:inline-block;width:auto;padding:10px 15px;border:0;border-radius:6px;background:#a81218;color:#fff!important;text-decoration:none;font-weight:bold}
.btn.small{padding:7px 12px}
.btn.neutral{background:#555}
.btn.blue{background:#247ba0}
.btn.orange{background:#c4810a}
.primary-button:hover,.btn:hover,.action-card:hover{filter:brightness(.93);transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,0,0,.12)}
.primary-button:active,.btn:active,.action-card:active{transform:translateY(1px)}

.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:22px}
.stat{position:relative;padding:19px 20px 19px 42px;background:#fff;border:1px solid #dde1e6;border-radius:9px}
.stat strong{display:block;font-size:31px}
.stat>span:last-child{display:block;color:#555}
.status-dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:7px;vertical-align:1px;background:#888}
.stat>.status-dot{position:absolute;left:20px;top:27px;width:12px;height:12px}

.yellow .status-dot{background:#e0ad00}
.blue .status-dot{background:#247ba0}
.orange .status-dot{background:#d8830c}
.green .status-dot{background:#398547}
.purple .status-dot{background:#7655b5}
.cyan .status-dot{background:#188aa0}
.emerald .status-dot{background:#197347}
.red .status-dot{background:#b51f2d}
.gray .status-dot{background:#777}

.stat.yellow{border-top:4px solid #e0ad00}
.stat.blue{border-top:4px solid #247ba0}
.stat.orange{border-top:4px solid #d8830c}
.stat.green{border-top:4px solid #398547}
.stat.purple{border-top:4px solid #7655b5}
.stat.cyan{border-top:4px solid #188aa0}
.stat.emerald{border-top:4px solid #197347}
.stat.red{border-top:4px solid #b51f2d}

.searchbar{display:flex;gap:10px;margin:20px 0}
.searchbar input{margin:0}
.table-scroll{overflow:auto;background:#fff;border:1px solid #dde1e6;border-radius:9px}
table{width:100%;border-collapse:collapse}
th,td{padding:14px;border-bottom:1px solid #ddd;text-align:left;vertical-align:middle}
th{background:#f0f2f4}
tr:last-child td{border-bottom:0}

.row-yellow{background:#fffdf5}
.row-blue{background:#f6fbfd}
.row-orange{background:#fffaf3}
.row-green{background:#f6fbf7}
.row-purple{background:#faf8fd}
.row-cyan{background:#f5fbfc}
.row-emerald{background:#f4faf7}
.row-red{background:#fff7f8}

.badge{display:inline-flex;align-items:center;padding:6px 10px;border-radius:18px;font-weight:bold;font-size:13px;white-space:nowrap}
.badge.yellow{background:#fff2b9;color:#695200}
.badge.blue{background:#def2fa;color:#14566f}
.badge.orange{background:#ffecd2;color:#764600}
.badge.green{background:#e0f2e4;color:#235c2f}
.badge.purple{background:#eee8fa;color:#51388b}
.badge.cyan{background:#ddf3f6;color:#126171}
.badge.emerald{background:#ddefe5;color:#155837}
.badge.red{background:#fde1e4;color:#81131e}
.badge.gray{background:#eee;color:#444}
.badge.big{font-size:15px;padding:9px 14px}

.actions{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.action-card{width:100%;min-height:70px;padding:15px 18px;border:0;border-radius:8px;color:#fff;font-size:16px;font-weight:bold;text-align:center}
.action-card.blue{background:#247ba0}
.action-card.green{background:#398547}
.action-card.orange{background:#c4810a}
.action-card.red{background:#a81218}
.action-card.purple{background:#7655b5}
.action-card.cyan{background:#188aa0}
.action-card.emerald{background:#197347}

.final-state{padding:18px;border-radius:8px;font-size:17px}
.final-state.emerald{background:#ddefe5}
.final-state.red{background:#fde1e4}

.correction-panel details summary{cursor:pointer!important;font-weight:bold;font-size:17px;color:#5a5a5a}
.details-body{padding-top:18px}
.details-body hr{border:0;border-top:1px solid #ddd;margin:26px 0}

.timeline-event{display:grid;grid-template-columns:18px 1fr;gap:12px;padding:10px 0;border-bottom:1px solid #eee}
.timeline-event:last-child{border-bottom:0}
.timeline-dot{display:block;width:12px;height:12px;border-radius:50%;margin-top:6px;background:#888}
.timeline-dot.yellow{background:#e0ad00}
.timeline-dot.blue{background:#247ba0}
.timeline-dot.orange{background:#d8830c}
.timeline-dot.green{background:#398547}
.timeline-dot.purple{background:#7655b5}
.timeline-dot.cyan{background:#188aa0}
.timeline-dot.emerald{background:#197347}
.timeline-dot.red{background:#b51f2d}
.event-type{display:inline-block;margin-left:8px;padding:2px 7px;border-radius:10px;background:#eee;color:#666;font-size:11px;text-transform:uppercase}
.timeline-event p{margin:6px 0 0;color:#555}

@media(max-width:900px){
.stats{grid-template-columns:repeat(2,1fr)}
.actions{grid-template-columns:1fr}
}

@media(max-width:700px){
.grid,.detail-grid,.stats{grid-template-columns:1fr}
.admin-title{align-items:flex-start;flex-direction:column}
.searchbar{flex-direction:column}
.searchbar .btn{width:100%;text-align:center}
.hero{padding:38px 20px}
}


/* V3.1 — eliminazione sicura */
.danger-zone{
    border:1px solid #efc9cd;
    background:#fffafb;
}
.danger-zone summary{
    cursor:pointer!important;
    color:#991824;
    font-size:17px;
    font-weight:bold;
}
.danger-warning{
    margin:0 0 18px;
    padding:14px;
    color:#71111b;
    background:#fdecee;
    border-left:5px solid #b51f2d;
    border-radius:4px;
}
.delete-btn{
    background:#8d111c!important;
}
.delete-btn:hover{
    background:#6f0d15!important;
}
