:root { --bg:#f5f6f8; --ink:#12151f; --muted:#667085; --line:#d9dee8; --panel:#fff; --orange:#ff7429; --blue:#2ea8df; --radius:8px; }
* { box-sizing:border-box; }
body { margin:0; font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background:var(--bg); color:var(--ink); }
a { color:inherit; }
.admin-guest { min-height:100vh; display:grid; place-items:center; background:linear-gradient(135deg,#080a11,#142033 55%,#36170b); padding:20px; }
.login-box { width:min(420px,100%); display:grid; gap:16px; background:#fff; border-radius:var(--radius); padding:30px; box-shadow:0 30px 90px rgba(0,0,0,.32); }
.login-box img { width:96px; margin:auto; }
.login-box h1 { margin:0; text-align:center; }
label { display:grid; gap:8px; font-size:15px; line-height:1.2; font-weight:850; color:#344054; }
input, select, textarea {
  width:100%;
  min-height:48px;
  border:1px solid #cfd5df;
  border-radius:var(--radius);
  padding:0 14px;
  appearance:none;
  -webkit-appearance:none;
  font:inherit;
  font-size:15px;
  line-height:1.25;
  font-weight:780;
  background:#fbfcfe;
  color:#12151f;
  box-shadow:inset 0 1px 0 rgba(16,24,40,.02);
  transition:border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
input, select { height:48px; }
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration { -webkit-appearance:none; }
select {
  padding-right:42px;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 21px,
    calc(100% - 14px) 21px;
  background-size:6px 6px, 6px 6px;
  background-repeat:no-repeat;
}
input::placeholder, textarea::placeholder { color:#98a2b3; font-weight:780; }
input:hover, select:hover, textarea:hover { border-color:#aeb8c8; background-color:#fff; }
input:focus, select:focus, textarea:focus { outline:3px solid rgba(46,168,223,.18); border-color:var(--blue); background-color:#fff; box-shadow:0 0 0 1px rgba(46,168,223,.08), inset 0 1px 0 rgba(16,24,40,.02); }
textarea { min-height:122px; padding:13px 14px; resize:vertical; }
button, .button { display:inline-flex; justify-content:center; align-items:center; min-height:48px; appearance:none; -webkit-appearance:none; border:0; border-radius:var(--radius); padding:10px 15px; background:var(--ink); color:#fff; text-decoration:none; font:inherit; font-size:15px; font-weight:900; line-height:1; cursor:pointer; transition:background .18s ease, color .18s ease, box-shadow .18s ease; }
button:hover, .button:hover { background:#0b8fca; color:#fff; box-shadow:0 10px 24px rgba(46,168,223,.2); }
.button-light { background:#eef2f7; color:#101828; border:1px solid #d8dee8; }
.button-light:hover { background:#e3f5fd; color:#0b6f9d; }
.admin-shell { display:grid; grid-template-columns:250px 1fr; min-height:100vh; }
.admin-sidebar { background:#eef1f5; color:#111827; padding:22px 18px; position:sticky; top:0; height:100vh; border-right:1px solid #d8dee8; }
.admin-brand { display:inline-flex; width:92px; margin:0 0 26px 4px; }
.admin-brand img { width:92px; }
.admin-sidebar nav { display:grid; gap:8px; }
.admin-sidebar a { padding:12px 12px; border-radius:var(--radius); text-decoration:none; color:#111827; font-weight:850; transition:background .18s ease, color .18s ease, transform .18s ease; }
.admin-sidebar a:hover, .admin-sidebar a.active { background:#dff3fc; color:#0b8fca; transform:translateX(2px); }
.admin-main { min-width:0; padding:26px 28px 46px; }
.admin-topbar { display:flex; justify-content:flex-end; min-height:36px; margin-bottom:18px; color:var(--muted); }
.admin-topbar div { display:grid; text-align:right; padding:8px 12px; border:1px solid rgba(17,24,39,.08); border-radius:999px; background:rgba(255,255,255,.62); }
.admin-topbar strong { color:#475467; line-height:1; }
.admin-topbar span { font-size:13px; line-height:1.15; }
.admin-page { display:grid; gap:18px; }
h1, h2, h3 { margin:0; letter-spacing:0; }
.stat-grid, .dashboard-grid, .detail-grid { display:grid; gap:14px; }
.stat-grid { grid-template-columns:repeat(4,1fr); }
.dashboard-grid { grid-template-columns:repeat(2,1fr); }
.detail-grid { grid-template-columns:1fr 1fr; }
.stat-grid article, .panel { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:18px; box-shadow:0 10px 28px rgba(16,24,40,.045); }
.stat-grid span { color:var(--muted); font-weight:800; }
.stat-grid strong { display:block; margin-top:8px; font-size:38px; }
.panel h2 { margin-bottom:14px; font-size:20px; }
.panel-head, .page-actions { display:flex; justify-content:space-between; align-items:center; gap:14px; }
.admin-page-title { align-items:flex-end; }
.admin-page-title h1 { font-size:34px; line-height:1; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; font-size:14px; }
th, td { padding:14px 12px; border-bottom:1px solid #edf0f4; text-align:left; vertical-align:top; }
th { color:var(--muted); font-size:12px; text-transform:uppercase; }
.badge { display:inline-flex; border-radius:999px; padding:6px 10px; background:#eef6ff; color:#175cd3; font-size:12px; font-weight:900; white-space:nowrap; }
.badge.status-nuova { background:#eef6ff; color:#175cd3; }
.badge.status-in-valutazione { background:#fff7e6; color:#b54708; }
.badge.status-contattata { background:#ecfdf3; color:#067647; }
.badge.status-selezionata { background:#e9f9ee; color:#027a48; }
.badge.status-scartata { background:#fff1f3; color:#b42318; }
.eyebrow-admin { margin:0 0 4px; color:var(--blue); font-size:12px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.filters { display:grid; gap:16px; padding:18px; }
.filters-title { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-bottom:12px; border-bottom:1px solid #edf0f4; }
.filters-title strong { font-size:18px; }
.filters-title span { color:var(--muted); font-size:13px; font-weight:850; }
.filter-search { display:grid; grid-template-columns:minmax(260px,1fr) auto; gap:12px; align-items:end; }
.filter-actions { display:flex; gap:8px; align-items:flex-end; }
.filter-actions button, .filter-actions .button { min-height:50px; }
.search-field input { min-height:50px; height:50px; font-size:15px; }
.filter-grid { display:grid; grid-template-columns:repeat(5, minmax(150px,1fr)); gap:12px; align-items:end; }
.filters label { min-width:0; }
.filters input, .filters select { min-height:48px; height:48px; }
.list-summary { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; flex-wrap:wrap; }
.filter-chips { display:flex; flex-wrap:wrap; gap:8px; }
.filter-chips a { display:inline-flex; align-items:center; gap:7px; padding:7px 10px; border:1px solid #b9e7f8; border-radius:999px; background:#f0faff; color:#0b6f9d; text-decoration:none; font-size:13px; font-weight:850; }
.filter-chips a:hover { background:#dff3fc; }
.filter-chips span { font-size:16px; line-height:1; }
.muted { color:var(--muted); margin:0; }
.pagination { display:flex; flex-wrap:wrap; gap:6px; }
.pagination a { padding:8px 11px; border:1px solid var(--line); border-radius:var(--radius); text-decoration:none; background:#fff; font-weight:850; }
.pagination a:hover { border-color:var(--blue); color:#0b8fca; }
.pagination .active { background:var(--blue); border-color:var(--blue); color:#fff; }
.sort-link { display:inline-flex; align-items:center; gap:6px; color:var(--muted); text-decoration:none; }
.sort-link small { display:inline-grid; place-items:center; min-width:18px; height:18px; border-radius:999px; background:#eef2f7; color:#475467; font-size:11px; text-decoration:none; }
.sort-link:hover, .sort-link.active { color:#0b8fca; }
.sort-link.active small { background:#dff3fc; color:#0b8fca; }
.table-main-link { color:#101828; font-weight:900; text-decoration:none; }
.table-main-link:hover { color:#0b8fca; }
.submissions-table { padding:16px; }
.submissions-table table { min-width:980px; }
.submissions-table tbody tr:hover { background:#fbfcfe; }
.empty-state { padding:34px 10px; text-align:center; color:var(--muted); font-weight:850; }
dl { display:grid; grid-template-columns:150px 1fr; gap:10px; margin:0; }
dt { color:var(--muted); font-weight:800; }
dd { margin:0; }
.links-row { display:flex; flex-wrap:wrap; gap:10px; }
.links-row a { padding:9px 11px; background:#f0f4f8; border-radius:var(--radius); text-decoration:none; font-weight:900; }
.file-list { display:grid; grid-template-columns:repeat(2,minmax(220px,1fr)); gap:12px; }
.file-card { display:grid; gap:5px; padding:14px; border:1px solid var(--line); border-radius:var(--radius); background:#fbfcfe; text-decoration:none; }
.file-card:hover { border-color:var(--blue); background:#f0faff; color:#0b8fca; }
.file-card span { color:#344054; overflow-wrap:anywhere; }
.file-card small { color:var(--muted); font-weight:850; }
.prose p { line-height:1.55; color:#344054; }
.admin-form { display:grid; gap:16px; }
.settings-form { grid-template-columns:1fr; }
.settings-form button { grid-column:1 / -1; }
.settings-sections { display:grid; grid-template-columns:1fr; gap:16px; }
.settings-group { margin:0; padding:20px; }
.settings-group legend { padding:0 8px; font-size:18px; font-weight:950; color:#12151f; }
.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(220px,1fr)); gap:14px; }
.settings-grid .wide { grid-column:1 / -1; }
.form-actions { display:flex; justify-content:flex-end; }
.sticky-actions { position:sticky; bottom:16px; z-index:3; padding:12px; border:1px solid var(--line); border-radius:var(--radius); background:rgba(255,255,255,.88); backdrop-filter:blur(12px); }
.note { border-top:1px solid var(--line); padding-top:12px; margin-top:12px; }
.note span { color:var(--muted); margin-left:8px; }
.inline-form { display:flex; gap:8px; min-width:260px; }
.inline-form input { min-width:150px; }
.notice { padding:12px 14px; border-radius:var(--radius); margin-bottom:14px; font-weight:800; }
.notice.success { background:#ecfdf3; color:#067647; border:1px solid #abefc6; }
.notice.error { background:#fff1f3; color:#b42318; border:1px solid #fda29b; }

@media (max-width: 980px) {
  .admin-shell { grid-template-columns:1fr; }
  .admin-sidebar { position:static; height:auto; }
  .admin-sidebar nav { grid-template-columns:repeat(2,1fr); }
  .stat-grid, .dashboard-grid, .detail-grid, .settings-form, .settings-grid, .file-list { grid-template-columns:1fr; }
  .admin-main { padding:18px; }
  .page-actions, .filter-search, .filter-actions, .filter-grid, .list-summary { grid-template-columns:1fr; flex-direction:column; align-items:stretch; }
  .filter-search, .filter-grid { grid-template-columns:1fr; }
  dl { grid-template-columns:1fr; }
}
