/* ============================================================
   GIGAPOINT Monitor — design system premium enterprise
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --bg: #060a14;
  --bg-2: #0a1020;
  --panel: #0b1222;
  --card: rgba(148, 170, 255, 0.045);
  --card-solid: #0e1730;
  --border: rgba(148, 170, 255, 0.13);
  --border-strong: rgba(148, 170, 255, 0.25);
  --text: #eef2ff;
  --muted: #8b96bd;
  --muted-2: #5d6890;
  --accent: #4f7cff;
  --accent-2: #7da2ff;
  --cyan: #22d3ee;
  --ok: #2dd47f;
  --warn: #eab308;
  --high: #fb923c;
  --crit: #f4506b;
  --info: #818cf8;
  --radius: 16px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --display: "Space Grotesk", "Inter", sans-serif;
  --shadow: 0 8px 30px rgba(3, 7, 18, 0.55);
  --side-w: 256px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* sfondo: glow + griglia tecnica */
.bg-fx {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(79, 124, 255, 0.13), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(34, 211, 238, 0.07), transparent 60%),
    var(--bg);
}
.bg-fx::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148, 170, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 170, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 75%);
}

::selection { background: rgba(79, 124, 255, 0.4); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #232e52; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ layout ============================ */
.layout { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  width: var(--side-w); flex-shrink: 0; position: fixed; inset: 0 auto 0 0;
  background: linear-gradient(180deg, rgba(13, 19, 38, 0.92), rgba(8, 12, 25, 0.92));
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 40;
  padding: 20px 14px;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 20px; }
.side-logo { width: 100%; height: auto; display: block; border-radius: 12px; }
.brand-fallback { display: none; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 0 22px rgba(79, 124, 255, 0.45);
  display: grid; place-items: center; font-weight: 800; font-size: 19px; color: #fff;
  font-family: var(--display);
}
.brand-name { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .4px; }
.brand-name span { color: var(--accent-2); font-weight: 500; }
.brand-sub { font-size: 10.5px; color: var(--muted-2); letter-spacing: .6px; text-transform: uppercase; margin-top: 2px; }

.side-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-section {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--muted-2);
  font-weight: 700; padding: 18px 10px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font: inherit; font-weight: 500; text-align: left; text-decoration: none;
  padding: 10px 12px; border-radius: 10px; transition: all .15s;
}
.nav-item:hover { color: var(--text); background: rgba(148, 170, 255, 0.07); }
.nav-item.active {
  color: var(--text); background: linear-gradient(90deg, rgba(79, 124, 255, 0.18), rgba(79, 124, 255, 0.06));
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-item .ico { width: 18px; text-align: center; flex-shrink: 0; }
.nav-item .health { margin-left: auto; }
.nav-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-foot {
  border-top: 1px solid var(--border); padding: 14px 10px 2px; margin-top: 10px;
  font-size: 11px; color: var(--muted-2); display: flex; justify-content: space-between; align-items: center;
}
.live-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; }
.live-dot::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 8px var(--ok); animation: pulse 2.2s infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- colonna principale ---------- */
.main-col { flex: 1; margin-left: var(--side-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 30px 14px;
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(180deg, rgba(6, 10, 20, 0.95), rgba(6, 10, 20, 0.82));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.page-head h1 { font-family: var(--display); font-size: 21px; margin: 0; letter-spacing: .2px; }
.page-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.topbar-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

select#clientSelect {
  background: var(--card-solid); color: var(--text); border: 1px solid var(--border);
  border-radius: 11px; padding: 10px 14px; font: inherit; font-size: 13.5px;
  min-width: 230px; cursor: pointer; transition: border-color .15s;
}
select#clientSelect:hover, select#clientSelect:focus { border-color: var(--accent); outline: none; }

.btn {
  border: 1px solid var(--border); background: var(--card-solid); color: var(--text);
  border-radius: 11px; padding: 10px 16px; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
  transition: all .15s;
}
.btn:hover { border-color: var(--border-strong); background: #131e3c; transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 18px rgba(79, 124, 255, 0.35);
}
.btn.primary:hover { box-shadow: 0 6px 24px rgba(79, 124, 255, 0.5); }
.btn.ghost { background: transparent; }
.icon-btn { display: none; }

/* ---------- banner ---------- */
.banner {
  margin: 16px 30px 0; padding: 13px 18px; border-radius: 13px; font-size: 13px;
  background: rgba(234, 179, 8, 0.09); border: 1px solid rgba(234, 179, 8, 0.35); color: #fde68a;
}
.banner.error { background: rgba(244, 80, 107, 0.09); border-color: rgba(244, 80, 107, 0.4); color: #fda4af; }
.banner code { background: rgba(0,0,0,.35); padding: 1px 7px; border-radius: 6px; }

main { padding: 24px 30px 70px; max-width: 1560px; width: 100%; }

.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 36px 0; justify-content: center; }
.spinner {
  width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

h2.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.8px; color: var(--muted);
  margin: 34px 0 14px; display: flex; align-items: center; gap: 10px; font-weight: 700;
}
h2.section-title .count {
  color: var(--text); background: var(--card-solid); border: 1px solid var(--border);
  border-radius: 9px; padding: 1px 9px; font-size: 11px;
}
h2.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- animazione ingresso ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.charts-grid > *, .client-grid > *, .tablewrap, .hero-row > * { animation: rise .45s cubic-bezier(.2,.7,.3,1) both; }
.charts-grid > *:nth-child(2), .client-grid > *:nth-child(2) { animation-delay: .05s; }
.charts-grid > *:nth-child(3), .client-grid > *:nth-child(3) { animation-delay: .1s; }
.charts-grid > *:nth-child(4), .client-grid > *:nth-child(4) { animation-delay: .15s; }
.charts-grid > *:nth-child(5), .client-grid > *:nth-child(5) { animation-delay: .2s; }
.charts-grid > *:nth-child(6) { animation-delay: .25s; }

/* ---------- hero (indice di salute) ---------- */
.hero-row { display: grid; grid-template-columns: 340px 1fr; gap: 16px; margin-bottom: 16px; }
.hero-card {
  background: linear-gradient(150deg, rgba(79, 124, 255, 0.13), rgba(13, 19, 38, 0.6) 55%);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 22px 24px; display: flex; align-items: center; gap: 22px;
  box-shadow: var(--shadow);
}
.gauge { width: 132px; height: 132px; flex-shrink: 0; filter: drop-shadow(0 0 14px rgba(79,124,255,.18)); }
.gauge .donut-value { font-size: 31px; }
.hero-card .hero-info h3 { margin: 0 0 6px; font-family: var(--display); font-size: 16px; }
.hero-card .hero-info p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.score-chip {
  display: inline-flex; padding: 3px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  margin-top: 10px; letter-spacing: .4px;
}

/* ---------- grafici donut ---------- */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 16px; }
.chart-card, .stat-card {
  background: var(--card); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); transition: border-color .2s, transform .2s;
}
.chart-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.chart-card.clickable { cursor: pointer; }
.chart-card.clickable:hover { border-color: var(--accent); box-shadow: 0 12px 32px rgba(3,7,18,.55); }
.chart-go { float: right; font-size: 10px; color: var(--accent-2); opacity: 0; transition: opacity .15s; letter-spacing: .3px; }
.chart-card.clickable:hover .chart-go { opacity: 1; }
.see-all { color: var(--accent-2); cursor: pointer; font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.see-all:hover { text-decoration: underline; }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.section-toolbar input {
  background: var(--card-solid); border: 1px solid var(--border); color: var(--text);
  border-radius: 11px; padding: 11px 14px; font: inherit; font-size: 14px; min-width: 280px; flex: 1; max-width: 420px;
}
.section-toolbar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,124,255,.18); }
.chart-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted);
  font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 7px;
}
.chart-body { display: flex; align-items: center; gap: 16px; }
.donut { width: 116px; height: 116px; flex-shrink: 0; }
.donut circle { transition: stroke-dasharray .7s cubic-bezier(.2,.7,.3,1); }
.donut-value { fill: var(--text); font-size: 25px; font-weight: 700; font-family: var(--display); }
.donut-sub { fill: var(--muted); font-size: 9.5px; letter-spacing: .5px; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.legend li {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted);
  padding: 3.5px 0; white-space: nowrap;
}
.legend li b { margin-left: auto; color: var(--text); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.legend .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 6px currentColor; }

.stat-strip {
  display: flex; align-items: center; justify-content: space-around; gap: 18px;
  height: 100%; flex-wrap: wrap; padding: 8px 0;
}
.stat-v { text-align: center; min-width: 90px; }
.stat-v b {
  display: block; font-size: 30px; font-weight: 700; font-family: var(--display);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.stat-v span { color: var(--muted); font-size: 11.5px; letter-spacing: .3px; }
.c-crit { color: var(--crit); text-shadow: 0 0 18px rgba(244,80,107,.4); }

.stat-card .stat-rows { display: flex; flex-direction: column; gap: 12px; }
.stat-card .stat { display: flex; align-items: baseline; gap: 12px; }
.stat-card .stat b { font-size: 27px; font-weight: 700; min-width: 58px; font-family: var(--display); font-variant-numeric: tabular-nums; }
.stat-card .stat span { color: var(--muted); font-size: 12px; }
.c-ok { color: var(--ok); }

/* ---------- card clienti ---------- */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.client-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; cursor: pointer; transition: all .2s; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.client-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--hl, transparent); opacity: .9;
}
.client-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 14px 36px rgba(3,7,18,.6); }
.client-card .name {
  font-weight: 700; font-size: 15px; font-family: var(--display);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.client-card .score {
  font-size: 12px; font-weight: 800; font-family: var(--display);
  padding: 3px 10px; border-radius: 999px; flex-shrink: 0;
}
.client-card .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.client-card .meter { height: 5px; border-radius: 4px; background: rgba(148,170,255,.12); margin-top: 14px; overflow: hidden; }
.client-card .meter i { display: block; height: 100%; border-radius: 4px; transition: width .6s; }
.client-card .row { display: flex; gap: 16px; margin-top: 10px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.client-card .row b { color: var(--text); font-variant-numeric: tabular-nums; }

.health { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.health.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.health.warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.health.crit { background: var(--crit); box-shadow: 0 0 8px var(--crit); }

/* ---------- badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2.5px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; letter-spacing: .2px;
}
.badge.critical, .badge.error { background: rgba(244,80,107,.13); color: #fda4af; border: 1px solid rgba(244,80,107,.4); }
.badge.high { background: rgba(251,146,60,.13); color: #fdba74; border: 1px solid rgba(251,146,60,.4); }
.badge.warning, .badge.medium { background: rgba(234,179,8,.12); color: #fde047; border: 1px solid rgba(234,179,8,.4); }
.badge.low, .badge.other, .badge.info { background: rgba(129,140,248,.13); color: #c7d2fe; border: 1px solid rgba(129,140,248,.4); }
.badge.ok { background: rgba(45,212,127,.12); color: #86efac; border: 1px solid rgba(45,212,127,.4); }
.badge.neutral { background: rgba(100,116,139,.15); color: #cbd5e1; border: 1px solid rgba(100,116,139,.4); }

/* ---------- tabelle ---------- */
.tablewrap {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: auto; box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 12px 16px; color: var(--muted); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700;
  border-bottom: 1px solid var(--border); background: rgba(10, 16, 32, .8);
  position: sticky; top: 0; backdrop-filter: blur(8px);
}
td { padding: 11px 16px; border-bottom: 1px solid rgba(148,170,255,.07); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr, table tr { transition: background .12s; }
tr:hover td { background: rgba(148,170,255,.04); }
td.muted, .muted { color: var(--muted); }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- dischi: barra spazio ---------- */
.space-bar { height: 6px; border-radius: 4px; background: rgba(148,170,255,.12); overflow: hidden; margin-bottom: 4px; }
.space-bar i { display: block; height: 100%; border-radius: 4px; transition: width .6s; }

/* ---------- apparati di rete ---------- */
.net-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.net-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.net-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--hl, transparent); }
.net-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.net-head { display: flex; align-items: center; gap: 11px; }
.net-ico {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; font-size: 19px;
  display: grid; place-items: center; background: rgba(79,124,255,.1); border: 1px solid rgba(79,124,255,.22);
}
.net-id { flex: 1; min-width: 0; }
.net-id b { font-family: var(--display); font-size: 14px; display: block; }
.net-id span { font-size: 11px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-ip { color: var(--muted-2); font-size: 11.5px; margin: 10px 0 12px; }
.net-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.net-metrics .metric { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; border-bottom: 1px solid rgba(148,170,255,.06); padding-bottom: 5px; }
.net-metrics .metric span { color: var(--muted); }
.net-metrics .metric b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- vista cliente ---------- */
.client-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.client-header h1 { font-family: var(--display); font-size: 24px; margin: 0; }
.client-header .sources { display: flex; gap: 8px; }

.tabs { display: flex; gap: 8px; margin: 26px 0 16px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--border); background: var(--card-solid); color: var(--muted);
  padding: 9px 18px; border-radius: 11px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  transition: all .15s;
}
.tab:hover { color: var(--text); border-color: var(--border-strong); }
.tab.active {
  background: linear-gradient(135deg, var(--accent), #6366f1); border-color: transparent; color: #fff;
  box-shadow: 0 4px 16px rgba(79,124,255,.35);
}
.tab .n { opacity: .75; font-weight: 400; }

/* ---------- modale ---------- */
.modal { position: fixed; inset: 0; background: rgba(3,6,14,.75); backdrop-filter: blur(6px); z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-box {
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 18px;
  width: min(740px, 100%); max-height: 85vh; overflow: auto; padding: 24px 28px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6); animation: rise .3s both;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-family: var(--display); }
.map-row {
  display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.map-row select {
  background: var(--card-solid); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 10px; width: 100%; font: inherit; font-size: 12.5px;
}
.map-status { font-size: 11px; }

/* ---------- link problemi noti patch ---------- */
.btn.ki-btn { padding: 5px 11px; font-size: 12px; }
.risk-flag { font-size: 16px; cursor: help; }

/* ---------- statusline ---------- */
.statusline {
  position: fixed; bottom: 0; left: var(--side-w); right: 0; display: flex; justify-content: space-between;
  padding: 9px 30px; font-size: 11.5px; color: var(--muted-2); z-index: 25;
  background: rgba(6, 10, 20, .9); border-top: 1px solid var(--border); backdrop-filter: blur(10px);
}

/* ============================ login premium ============================ */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; position: relative; }

/* --- pannello vetrina (sinistra) --- */
.login-aside {
  position: relative; overflow: hidden; padding: 52px 58px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 30px;
  background:
    radial-gradient(820px 540px at 18% -8%, rgba(79,124,255,.26), transparent 58%),
    radial-gradient(680px 520px at 112% 116%, rgba(34,211,238,.14), transparent 60%),
    linear-gradient(160deg, #0a1228, #070b18);
  border-right: 1px solid var(--border);
}
.login-aside .grid-fx {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(148,170,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,170,255,.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 85% 80% at 35% 25%, #000, transparent 82%);
}
.login-aside .orb {
  position: absolute; border-radius: 50%; filter: blur(44px); opacity: .42; pointer-events: none;
  animation: float 16s ease-in-out infinite; will-change: transform;
}
.login-aside .orb.a { width: 280px; height: 280px; background: #3b6dff55; top: -50px; left: -30px; }
.login-aside .orb.b { width: 230px; height: 230px; background: #22d3ee33; bottom: 40px; right: -20px; animation-delay: -6s; }
@keyframes float { 50% { transform: translateY(-22px) translateX(12px); } }

.login-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }

.login-hero { position: relative; z-index: 1; }
.login-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700;
  letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent-2);
  background: rgba(79,124,255,.1); border: 1px solid rgba(79,124,255,.28);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}
.login-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: pulse 2.2s infinite; }
.login-hero h1 {
  font-family: var(--display); font-size: clamp(30px, 3.6vw, 46px); line-height: 1.12;
  margin: 0 0 18px; letter-spacing: -.6px;
}
.login-hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent-2), var(--cyan), var(--accent-2));
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; animation: shimmer 5s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }
.login-hero p { color: var(--muted); font-size: 15px; line-height: 1.65; max-width: 470px; margin: 0 0 30px; }

/* mini-cruscotto live nel pannello */
.login-stage {
  position: relative; z-index: 1;
  background: rgba(13,21,44,.72);
  border: 1px solid var(--border); border-radius: 18px; padding: 20px 22px;
  display: flex; flex-direction: column; gap: 18px; max-width: 470px;
  box-shadow: var(--shadow);
}
.stage-top { display: flex; align-items: center; gap: 20px; }
.stage-gauge { width: 92px; height: 92px; flex-shrink: 0; }
.stage-gauge .donut-value { font-size: 23px; }
.stage-tiles { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.stage-tile b { font-family: var(--display); font-size: 19px; font-variant-numeric: tabular-nums; display: block; line-height: 1.2; }
.stage-tile span { color: var(--muted); font-size: 10.5px; letter-spacing: .3px; }
.stage-feed { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.feed-line { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); animation: feedin .5s both; }
.feed-line .fdot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 7px currentColor; }
.feed-line b { color: var(--text); font-weight: 600; }
.feed-line time { margin-left: auto; color: var(--muted-2); font-size: 10.5px; font-variant-numeric: tabular-nums; }
@keyframes feedin { from { opacity: 0; transform: translateX(-8px); } }

.login-trust { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; color: var(--muted-2); font-size: 11.5px; flex-wrap: wrap; }
.login-trust .src { display: inline-flex; align-items: center; gap: 7px; }
.login-trust .src b { color: var(--muted); font-weight: 600; }
.login-foot { color: var(--muted-2); font-size: 11px; position: relative; z-index: 1; }

/* --- pannello accesso (destra) --- */
.login-main { display: grid; place-items: center; padding: 40px 30px; position: relative; }
.login-main .bg-fx { z-index: 0; }
.login-box {
  position: relative; z-index: 1;
  background: rgba(14, 23, 48, .62); backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong); border-radius: 24px;
  padding: 44px 40px 36px; width: min(424px, 100%);
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
  animation: rise .55s cubic-bezier(.2,.7,.3,1) both;
}
.login-box::before {
  content: ""; position: absolute; inset: 0; border-radius: 24px; padding: 1px;
  background: linear-gradient(160deg, rgba(125,162,255,.55), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.login-box .lock {
  width: 56px; height: 56px; border-radius: 17px; margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 0 34px rgba(79,124,255,.55);
  display: grid; place-items: center; font-size: 24px; position: relative;
}
.login-box .lock::after {
  content: ""; position: absolute; inset: -5px; border-radius: 20px;
  border: 1px solid rgba(125,162,255,.35); animation: ring 2.6s ease-out infinite;
}
@keyframes ring { 0% { transform: scale(.9); opacity: .8; } 100% { transform: scale(1.25); opacity: 0; } }
.login-box h2 { font-family: var(--display); text-align: center; margin: 0 0 6px; font-size: 22px; }
.login-box .sub { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 28px; }

.field { position: relative; margin-bottom: 16px; }
.field input {
  width: 100%; background: rgba(6,10,20,.7); border: 1px solid var(--border); color: var(--text);
  border-radius: 13px; padding: 16px 46px 16px 16px; font: inherit; font-size: 14.5px;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: transparent; }
.field label {
  position: absolute; left: 16px; top: 16px; color: var(--muted); font-size: 14.5px;
  pointer-events: none; transition: all .15s ease; background: linear-gradient(180deg, transparent 45%, #0c1428 45%); padding: 0 5px;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: -8px; left: 12px; font-size: 11px; color: var(--accent-2); font-weight: 600;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,124,255,.2); }
.field .toggle-pw {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 6px;
}
.field .toggle-pw:hover { color: var(--text); }

.login-box button[type=submit] {
  width: 100%; padding: 15px; font-size: 14.5px; font-weight: 700; justify-content: center;
  letter-spacing: .3px; margin-top: 4px;
}
.login-err {
  color: #fda4af; font-size: 13px; margin-top: 14px; text-align: center;
  background: rgba(244,80,107,.1); border: 1px solid rgba(244,80,107,.35);
  border-radius: 10px; padding: 9px;
}
.login-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 18px; color: var(--muted-2); font-size: 11px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-sec { display: flex; justify-content: center; gap: 18px; color: var(--muted-2); font-size: 11px; }
.login-sec span { display: inline-flex; align-items: center; gap: 6px; }
.login-status {
  position: relative; z-index: 1; margin-top: 22px; display: flex; justify-content: center;
}
.login-status .pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ok);
  background: rgba(45,212,127,.08); border: 1px solid rgba(45,212,127,.3);
  padding: 7px 14px; border-radius: 999px;
}
.login-status .pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: pulse 2.2s infinite; }

/* ============================ responsive ============================ */
@media (max-width: 1080px) {
  .hero-row { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-aside { display: none; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: 30px 0 80px rgba(0,0,0,.5); }
  .main-col { margin-left: 0; }
  .statusline { left: 0; }
  .icon-btn {
    display: inline-flex; border: 1px solid var(--border); background: var(--card-solid);
    color: var(--text); border-radius: 10px; padding: 9px 12px; cursor: pointer; font-size: 16px;
  }
  .topbar { padding: 14px 16px; }
  main { padding: 16px 16px 70px; }
  .banner { margin: 14px 16px 0; }
  select#clientSelect { min-width: 150px; flex: 1; }
}
