:root{
  --bg:#0b1020;
  --panel:rgba(255,255,255,.06);
  --panel2:rgba(255,255,255,.08);
  --text:#eef2ff;
  --muted:rgba(238,242,255,.65);
  --border:rgba(255,255,255,.10);
  --accent:#5bbcff;
  --accent2:#7c5cff;
  --danger:#ff4d6d;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
  background:
    radial-gradient(1000px 600px at 20% 10%, rgba(91,188,255,.25), transparent 60%),
    radial-gradient(900px 600px at 80% 20%, rgba(124,92,255,.22), transparent 55%),
    var(--bg);
}

.small{ font-size:12px; color:var(--muted); }
.container{ min-height:100vh; display:flex; }

.sidebar{
  width:260px;
  padding:16px;
  border-right:1px solid var(--border);
  background:rgba(0,0,0,.20);
  backdrop-filter: blur(10px);
}

.brand{
  font-weight:900;
  letter-spacing:.2px;
  font-size:16px;
  padding:10px 10px;
  border:1px solid var(--border);
  border-radius:14px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
}

.nav{ display:flex; flex-direction:column; gap:8px; margin-top:12px; }
.nav button{
  text-align:left;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
  transition: transform .05s ease, background .15s ease, border .15s ease;
}
.nav button:hover{ background:rgba(255,255,255,.06); }
.nav button:active{ transform: translateY(1px); }
.nav button.active{
  border-color: rgba(91,188,255,.45);
  background: rgba(91,188,255,.12);
}

.main{ flex:1; padding:16px; }

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  margin-bottom:12px;
}

.card{
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border-radius:18px;
  padding:14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.25);
}

label{
  display:block;
  margin-top:10px;
  margin-bottom:6px;
  font-size:12px;
  color:var(--muted);
}

input, select, textarea{
  width:100%;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.22);
  color:var(--text);
  padding:10px 10px;
  outline:none;
}
textarea{ min-height:80px; resize:vertical; }

.row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

.btn{
  padding:10px 14px;
  border-radius:12px;
  border:1px solid rgba(91,188,255,.45);
  background: rgba(91,188,255,.15);
  color:var(--text);
  cursor:pointer;
  font-weight:800;
  letter-spacing:.3px;
  transition: transform .05s ease, background .15s ease;
}
.btn:hover{ background: rgba(91,188,255,.20); }
.btn:active{ transform: translateY(1px); }

.btn.secondary{
  border-color: var(--border);
  background: rgba(255,255,255,.05);
  font-weight:700;
}
.btn.secondary:hover{ background: rgba(255,255,255,.07); }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.grid .full{ grid-column: 1 / -1; }
.grid-3{ grid-template-columns: 1fr 1fr 1fr; }

.split{
  display:grid;
  grid-template-columns: 440px 1fr;
  gap:12px;
  align-items:stretch;
}

.badge{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  font-size:12px;
  font-weight:700;
}
.dot{ width:10px;height:10px;border-radius:50%; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }

.table{ width:100%; border-collapse:collapse; font-size:13px; }
.table th, .table td{ padding:10px 10px; border-bottom:1px solid rgba(255,255,255,.08); vertical-align:top; }
.table th{ text-align:left; color:var(--muted); font-size:12px; font-weight:800; }

.toast{
  position:fixed;
  right:16px;
  bottom:16px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 50px rgba(0,0,0,.35);
  z-index:9999;
}

.modal-backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.55);
  display:flex;
  justify-content:center;
  align-items:center;
  z-index:9998;
  padding:16px;
}
.modal{
  width:min(560px, 100%);
  border-radius:18px;
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  padding:14px;
  box-shadow: 0 20px 70px rgba(0,0,0,.45);
}

/* Leaflet containers */
#map, #mapFull{
  width:100%;
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
}

/* ✅ altezza default (serve soprattutto al TECNICO) */
#map{
  height:60vh;
  min-height:460px;
}

/* ✅ Admin: mappa "Aggiungi ticket" ancora più alta */
#view-addTicket #map{
  height:78vh;
  min-height:640px;
}

@media (max-width: 980px){
  .sidebar{ width:230px; }
  .split{ grid-template-columns: 1fr; }
  .grid{ grid-template-columns: 1fr; }
  .grid-3{ grid-template-columns: 1fr; }
  #map{ height:55vh; min-height:380px; }
  #view-addTicket #map{ height:60vh; min-height:420px; }
}