:root {

  --bg: #eef1f6; --panel: #ffffff; --panel-2: #f5f8fc; --bordo: #dce2ea;

  --testo: #1f2a37; --muto: #6b7686; --primario: #2563eb; --primario-2: #1d4ed8;

  --ok: #0a7d33; --no: #b42318; --accent: #7c3aed;

  --topbar: #0f172a; --topbar-testo: #e8eefb;

  --drawer: #0f172a; --drawer-testo: #cbd5e1; --drawer-attivo: #1e293b;

  --ombra: 0 1px 3px rgba(16,24,40,.09), 0 1px 2px rgba(16,24,40,.05);

  --h-top: 58px;

}

@media (prefers-color-scheme: dark) {

  :root:not([data-theme="light"]) {

    --bg: #0b1220; --panel: #111a2b; --panel-2: #0f1726; --bordo: #243247;

    --testo: #e6edf6; --muto: #93a1b5; --topbar: #0a0f1a; --drawer: #0a0f1a;

    --drawer-attivo: #16213a; --ombra: none;

  }

}



* { box-sizing: border-box; }

html, body { height: 100%; }

body {

  margin: 0; background: var(--bg); color: var(--testo);

  font: 14.5px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;

}

button, input, select { font: inherit; }

a { color: var(--primario); text-decoration: none; }



/* ---------- Login ---------- */

#login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }

.login {

  width: 100%; max-width: 360px; background: var(--panel);

  border: 1px solid var(--bordo); border-radius: 16px; padding: 26px;

  box-shadow: var(--ombra); display: flex; flex-direction: column; gap: 10px;

}

.login .logo-img { width: 60px; height: 60px; border-radius: 15px; box-shadow: var(--ombra); }

.login h1 { font-size: 21px; margin: 0; letter-spacing: -.01em; }

.brand-img { width: 26px; height: 26px; border-radius: 7px; vertical-align: -6px; }

.login label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muto); }

input, select {

  padding: 9px 11px; border: 1px solid var(--bordo); border-radius: 9px;

  background: var(--panel-2); color: var(--testo); width: 100%;

}

input:focus, select:focus { outline: 2px solid var(--primario); border-color: transparent; }

button {

  padding: 9px 14px; border: 0; border-radius: 9px; background: var(--primario);

  color: #fff; cursor: pointer; font-weight: 600;

}

button:hover { background: var(--primario-2); }

button.ghost { background: var(--panel-2); color: var(--testo); border: 1px solid var(--bordo); font-weight: 500; }

button.ghost:hover { background: var(--bg); }

button:disabled { opacity: .55; cursor: default; }

.err { color: var(--no); min-height: 1.2em; margin: 2px 0 0; font-size: 13px; }

.muted { color: var(--muto); }



/* ---------- Topbar ---------- */

.topbar {

  position: fixed; top: 0; left: 0; right: 0; height: var(--h-top); z-index: 30;

  display: flex; align-items: center; gap: 12px; padding: 0 16px;

  background: var(--topbar); color: var(--topbar-testo);

  box-shadow: 0 1px 10px rgba(0,0,0,.15);

}

.hamb { width: 42px; height: 42px; display: inline-flex; flex-direction: column;

  justify-content: center; align-items: center; gap: 5px; background: transparent;

  border: 0; cursor: pointer; border-radius: 9px; }

.hamb:hover { background: rgba(255,255,255,.08); }

.hamb span { width: 22px; height: 2px; background: var(--topbar-testo); border-radius: 2px; transition: transform .22s, opacity .22s; }

body.menu-open .hamb span:nth-child(1) { transform: translateY(7px) rotate(45deg); }

body.menu-open .hamb span:nth-child(2) { opacity: 0; }

body.menu-open .hamb span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.topbar .brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; }

.topbar .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(124,58,237,.3); }

.topbar-titolo { color: #9fb0cc; font-size: 13.5px; border-left: 1px solid rgba(255,255,255,.15); padding-left: 12px; }

.topbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.topbar .right .ghost { background: rgba(255,255,255,.08); color: var(--topbar-testo); border-color: rgba(255,255,255,.14); }

.topbar .right .ghost:hover { background: rgba(255,255,255,.16); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; background: rgba(255,255,255,.1); font-size: 12.5px; }

@media (max-width: 560px) { .topbar-titolo, .pill { display: none; } }



/* ---------- Drawer (menu a scomparsa) ---------- */

.overlay {

  position: fixed; inset: var(--h-top) 0 0 0; background: rgba(2,6,23,.5);

  opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 24;

}

body.menu-open .overlay { opacity: 1; pointer-events: auto; }

.drawer {

  position: fixed; top: var(--h-top); left: 0; width: 256px;

  height: calc(100vh - var(--h-top)); z-index: 25; background: var(--drawer);

  color: var(--drawer-testo); padding: 14px 12px; display: flex;

  flex-direction: column; gap: 4px; transform: translateX(-100%);

  transition: transform .22s ease; box-shadow: 2px 0 16px rgba(0,0,0,.2);

}

body.menu-open .drawer { transform: translateX(0); }

.drawer nav { display: flex; flex-direction: column; gap: 4px; }

.nav-item {

  display: flex; align-items: center; gap: 11px; padding: 11px 13px;

  border-radius: 10px; color: var(--drawer-testo); cursor: pointer; border: 0;

  background: transparent; width: 100%; text-align: left; font-size: 14.5px;

}

.nav-item:hover { background: var(--drawer-attivo); color: #fff; }

.nav-item.attivo { background: var(--drawer-attivo); color: #fff; font-weight: 600; }

.nav-item .ico { width: 20px; text-align: center; }

.drawer .mini { margin-top: auto; font-size: 11.5px; color: #64748b; padding: 10px 8px; }



/* ---------- Contenuto centrato ---------- */

.main { padding-top: var(--h-top); }

.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 48px; }

.page-head { margin-bottom: 18px; }

.page-head h2 { margin: 0; font-size: 22px; }

.page-head .sub { color: var(--muto); font-size: 13.5px; }

.sezione { display: none; } .sezione.attiva { display: block; }



/* ---------- Cards / tiles ---------- */

.card { background: var(--panel); border: 1px solid var(--bordo); border-radius: 14px; padding: 16px; box-shadow: var(--ombra); }

.card h3 { margin: 0 0 12px; font-size: 13px; color: var(--muto); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

.griglia { display: grid; gap: 16px; }

.griglia.tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.griglia.due { grid-template-columns: 1fr 1fr; }

@media (max-width: 820px) { .griglia.due { grid-template-columns: 1fr; } }

.tile { display: flex; flex-direction: column; gap: 4px; }

.tile .num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }

.tile .lab { color: var(--muto); font-size: 13px; }

.tile .ico-big { font-size: 20px; }



/* ---------- Bar list ---------- */

.barlist { display: flex; flex-direction: column; gap: 9px; max-height: 340px; overflow: auto; }

.barrow { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }

.barrow .lbl { display: flex; align-items: center; gap: 8px; min-width: 0; }

.barrow .lbl .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.barrow .val { color: var(--muto); font-variant-numeric: tabular-nums; font-size: 13px; }

.bar { grid-column: 1 / -1; height: 7px; background: var(--panel-2); border-radius: 6px; overflow: hidden; border: 1px solid var(--bordo); }

.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primario), var(--accent)); }

.flag { font-size: 17px; line-height: 1; }

.flag-img { width: 24px; height: 18px; border-radius: 3px; object-fit: cover;

  box-shadow: 0 0 0 1px rgba(0,0,0,.14); vertical-align: -4px; }

.flag-noimg { font-size: 17px; }

.paese-card .flag-img { width: 36px; height: 27px; border-radius: 4px; }

.paese-card .flag-noimg { font-size: 26px; }

#campione-titolo .flag-img { width: 28px; height: 21px; vertical-align: -5px; }



/* ---------- Paesi grid ---------- */

.paesi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.paese-card { background: var(--panel); border: 1px solid var(--bordo); border-radius: 14px; padding: 14px; box-shadow: var(--ombra); }

.paese-card .top { display: flex; align-items: center; gap: 10px; }

.paese-card .flag { font-size: 26px; }

.paese-card .nm { font-weight: 600; }

.paese-card .cnt { color: var(--muto); font-size: 13px; }

.paese-copertura { margin-top: 12px; border-top: 1px solid var(--bordo); padding-top: 9px; }

.paese-copertura summary { cursor: pointer; font-size: 13px; font-weight: 600; }

.paese-campi-nota { color: var(--muto); font-size: 12px; margin-top: 7px; }

.paese-campi { display: flex; flex-direction: column; gap: 11px; max-height: none; overflow: visible; margin-top: 12px; padding-right: 0; }

.paese-campo { min-width: 0; }

.paese-campo-valori { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: 16px; font-size: 14px; line-height: 1.45; }

.paese-campo-valori .nm { min-width: 0; overflow-wrap: anywhere; }

.paese-campo-valori strong { flex: 0 0 auto; color: #53637a; font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.paese-campo-barra { height: 7px; margin-top: 5px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }

.paese-campo-barra i { display: block; height: 100%; background: linear-gradient(90deg, var(--primario), var(--accent)); }

.paese-card .azioni { display: flex; gap: 8px; margin-top: 12px; }

.paese-card .azioni button { padding: 6px 10px; font-size: 13px; }



/* ---------- Filtri / tabelle ---------- */

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }

.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muto); }

.inline select, .inline input { width: auto; }

#colonne { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }

.chk { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; }

.chk input { width: auto; margin: 0; }

.mini-btn { padding: 4px 10px; font-size: 12px; }

.kv { display: inline-block; margin-right: 8px; font-size: 12px; white-space: nowrap; }

.filtro { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 7px 0; }

.filtro select, .filtro input { width: auto; min-width: 150px; }

.filtro .x { background: #fde7e7; color: var(--no); border: 1px solid #f3c0c0; padding: 8px 11px; }

.tablewrap { overflow: auto; max-height: 58vh; border: 1px solid var(--bordo); border-radius: 12px; background: var(--panel); }

table { border-collapse: collapse; width: 100%; font-size: 13.5px; }

th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--bordo); white-space: nowrap; }

thead th { position: sticky; top: 0; background: var(--panel-2); z-index: 1; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muto); }

tbody tr:hover { background: var(--panel-2); }



/* ---------- Upload ---------- */

.dropzone { border: 2px dashed var(--bordo); border-radius: 14px; padding: 34px; text-align: center; color: var(--muto); background: var(--panel-2); cursor: pointer; }

.dropzone.hover { border-color: var(--primario); color: var(--testo); }

.progress { height: 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--bordo); overflow: hidden; margin-top: 12px; }

.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primario), var(--accent)); transition: width .15s; }

.form-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }

.form-row > label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muto); flex: 1 1 200px; }

.spinner { width: 16px; height: 16px; border: 2px solid var(--bordo); border-top-color: var(--primario); border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -3px; }

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }



/* ---------- Sistema visivo Datalonix ---------- */

:root {

  --bg: #f3f6fa;

  --panel: #ffffff;

  --panel-2: #f8fafc;

  --bordo: #e2e8f0;

  --testo: #182437;

  --muto: #68778d;

  --primario: #2458d3;

  --primario-2: #1947b5;

  --ok: #18794e;

  --no: #b42318;

  --accent: #16a085;

  --topbar: #ffffff;

  --topbar-testo: #182437;

  --drawer: #142235;

  --drawer-testo: #c3cfdd;

  --drawer-attivo: #223650;

  --ombra: 0 1px 2px rgba(20,35,55,.04), 0 8px 24px rgba(20,35,55,.045);

  --h-top: 72px;

}



html { scroll-behavior: smooth; }

body { background: var(--bg); color: var(--testo); font: 14px/1.55 Inter, "Segoe UI", system-ui, sans-serif; }

button, input, select { font: inherit; }

button { border-radius: 8px; padding: 10px 16px; transition: background .16s ease, box-shadow .16s ease, transform .16s ease; }

button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(27,61,125,.12); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(36,88,211,.3); outline-offset: 2px; }

input, select { background: #fff; min-height: 42px; border-color: #d8e0eb; border-radius: 8px; }

input:hover, select:hover { border-color: #aab8cb; }

button.ghost { border-color: #d9e1ec; background: #fff; }



#login { background: radial-gradient(ellipse at 15% 15%, #dce9ff 0, transparent 38%), linear-gradient(145deg,#f6f8fc,#eaf0f7); }

.login { max-width: 430px; padding: 38px; gap: 16px; border: 1px solid #e3e9f2; border-radius: 18px; box-shadow: 0 24px 70px rgba(26,48,80,.13); }

.login .logo-img { width: 52px; height: 52px; border-radius: 13px; }

.login h1 { font-size: 26px; letter-spacing: -.035em; }

.login label, .form-row > label { color: #53637a; font-size: 13px; font-weight: 550; }



.topbar { height: var(--h-top); padding: 0 32px; background: rgba(255,255,255,.96); color: var(--testo); border-bottom: 1px solid var(--bordo); box-shadow: 0 1px 3px rgba(20,35,55,.035); backdrop-filter: blur(12px); }

.topbar .brand { font-size: 15px; font-weight: 750; letter-spacing: -.02em; }

.topbar .brand-img { width: 30px; height: 30px; border-radius: 8px; }

.topbar-titolo { color: #78869a; font-size: 13px; border-color: #e3e9f1; }

.topbar .right .ghost { color: #40516a; background: #fff; border-color: #e0e6ee; }

.topbar .pill { color: #34465e; background: #f1f5f9; font-variant-numeric: tabular-nums; }

.drawer { padding: 24px 14px 16px; gap: 14px; background: var(--drawer); box-shadow: 8px 0 28px rgba(14,27,44,.09); }

.drawer::before { content: "SPAZIO DI LAVORO"; padding: 0 12px 8px; color: #8495aa; font-size: 10px; font-weight: 750; letter-spacing: .13em; }

.drawer nav { gap: 6px; }

.nav-item { min-height: 44px; padding: 10px 12px; border-radius: 8px; color: #c3cfdd; font-size: 13px; font-weight: 520; }

.nav-item .ico { filter: grayscale(1); opacity: .8; }

.nav-item .ico svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.nav-item.attivo { color: #fff; background: #243a55; box-shadow: inset 3px 0 #6ba6ff; }

.nav-item.attivo .ico { filter: none; opacity: 1; }

.drawer .mini { padding: 14px 12px 8px; border-top: 1px solid rgba(255,255,255,.09); color: #8797aa; line-height: 1.5; }



.main { padding-top: var(--h-top); }

.container { max-width: 1520px; padding: 30px 36px 56px; }

.page-head { margin-bottom: 24px; }

.page-head h2 { color: #142238; font-size: 27px; line-height: 1.2; font-weight: 720; letter-spacing: -.04em; }

.page-head .sub { margin-top: 6px; color: #748299; font-size: 14px; }

.card, .paese-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; box-shadow: var(--ombra); }

.card h3 { margin-bottom: 15px; color: #273951; font-size: 15px; font-weight: 680; text-transform: none; letter-spacing: -.01em; }

.card h4 { color: #33465f; font-size: 14px; }

.griglia { gap: 18px; }

.griglia.due { grid-template-columns: repeat(2,minmax(0,1fr)); }

.griglia.tiles { grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); }

.tile { min-height: 134px; justify-content: center; gap: 7px; position: relative; overflow: hidden; }

.tile::after { content: ""; position: absolute; width: 88px; height: 88px; right: -26px; top: -28px; border-radius: 50%; background: #eff5ff; }

.tile .ico-big { position: relative; z-index: 1; width: 20px; height: 20px; color: #5078c7; }

.tile .ico-big svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

.tile .num { position: relative; z-index: 1; color: #17283f; font-size: 31px; line-height: 1.15; font-weight: 730; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }

.tile .lab { position: relative; z-index: 1; font-size: 12px; font-weight: 560; }

.barlist { max-height: 380px; gap: 13px; }

.bar { height: 6px; border: 0; background: #edf1f6; }

.bar > i, .paese-campo-barra i { border-radius: inherit; background: linear-gradient(90deg,#3168df,#5f91ed); }

.barrow .val { color: #53637a; font-size: 12px; font-variant-numeric: tabular-nums; }

.paesi-grid { width: 100%; gap: 18px; grid-template-columns: minmax(0,1fr); }

.paese-card { width: 100%; min-width: 0; padding: 22px 24px; }

.paese-card .nm { color: #203149; font-size: 14px; font-weight: 680; }

.flag-code { display: inline-flex; width: 36px; height: 27px; align-items: center; justify-content: center; border: 1px solid #dbe4ef; border-radius: 5px; background: #f2f6fb; color: #4d6280; font-size: 10px; font-weight: 750; letter-spacing: .06em; vertical-align: middle; }

.flag-emoji { display: inline-block; font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; font-size: 27px; line-height: 1.1; vertical-align: middle; }

.paese-card .cnt { margin-top: 2px; font-size: 12px; }

.paese-copertura { border-color: #edf1f5; }

.paese-campo-valori { font-size: 14px; }

.paese-campo-valori strong { color: #53637a; font-size: 13px; }

.paese-campo-barra { background: #edf1f6; }

.dashboard-paesi-head { justify-content: space-between; align-items: flex-start; }

.dashboard-paesi-head h3 { margin-bottom: 4px; }

.dashboard-paesi-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 10px; }

.dashboard-paese { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 13px 14px; border: 1px solid var(--bordo); border-radius: 10px; background: var(--panel-2); color: var(--testo); text-align: left; }

.dashboard-paese:hover { border-color: #9cb7e8; background: #f2f6fc; }

.dashboard-paese-flag { display: grid; width: 36px; flex: 0 0 36px; place-items: center; }

.dashboard-paese-flag .flag-emoji { font-size: 27px; }

.dashboard-paese-info { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }

.dashboard-paese-nome { overflow-wrap: anywhere; font-size: 13px; font-weight: 700; }

.dashboard-paese-record { color: var(--muto); font-size: 12px; font-variant-numeric: tabular-nums; }

.dashboard-paese-apri { color: var(--primario); font-size: 21px; line-height: 1; }

.batch-steps { margin: 0 0 14px; padding-left: 22px; color: var(--testo); }

.batch-steps li { margin: 6px 0; padding-left: 3px; }

.batch-auto-mode { display: block; margin: 12px 0; padding: 12px 14px; border: 1px solid var(--bordo); border-radius: 9px; background: var(--panel-2); line-height: 1.5; }

.batch-timeline { display: grid; gap: 6px; max-height: 260px; overflow: auto; margin: 0 0 16px; padding: 0; list-style: none; }

.batch-timeline li { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 12px; padding: 9px 11px; border-left: 3px solid #7094d8; border-radius: 4px; background: var(--panel-2); }

.batch-timeline time { color: var(--muto); font-size: 12px; font-variant-numeric: tabular-nums; }

.batch-timeline .batch-event-message { overflow-wrap: anywhere; }

.batch-selected-flag { display: inline-block; min-width: 34px; margin-right: 6px; text-align: center; vertical-align: middle; }

.batch-country-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }

.batch-excluded-list { display: grid; gap: 6px; margin: 8px 0 14px; padding-left: 22px; }

.batch-excluded-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 900px; padding: 6px 0; }

.batch-operation { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--bordo); border-radius: 10px; background: var(--panel-2); }

.batch-operation-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }

.batch-operation-heading strong { font-size: 14px; }

.batch-operation-heading span, #folder-batch-operation-detail { color: var(--muto); font-size: 13px; }

#folder-batch-operation-progress { display: block; width: 100%; height: 12px; accent-color: var(--primario); }

#folder-batch-operation-progress[hidden] { display: none; }

#folder-batch-operation-detail { min-height: 1.5em; }

#folder-batch-operation-detail { margin: 8px 0 0; line-height: 1.5; }

#folder-batch-log { max-width: 100%; overflow-x: auto; }

#folder-batch-log table { min-width: 900px; width: 100%; }



.toolbar { gap: 10px; margin-bottom: 15px; }

.tablewrap, .batch-table-wrap { border: 1px solid #e1e7ef; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(20,35,55,.025); }

.batch-table-wrap { overflow: auto; max-width: 100%; margin: 12px 0; }

table { font-size: 12.5px; }

th, td { padding: 11px 13px; border-bottom-color: #edf1f5; }

thead th { background: #f7f9fc; color: #627188; font-size: 10px; font-weight: 750; letter-spacing: .08em; }

tbody tr:nth-child(even) { background: #fcfdff; }

tbody tr:hover { background: #f1f6ff; }

.dropzone { padding: 40px; border: 1px dashed #aabbd1; border-radius: 12px; background: linear-gradient(180deg,#fbfdff,#f6f9fd); }

.dropzone.hover { border-style: solid; background: #f0f6ff; }

.progress { height: 9px; border: 0; background: #e9eef5; }

.progress > i { background: linear-gradient(90deg,#2458d3,#24a58b); }

.form-row { gap: 16px; margin: 16px 0; }

.form-row > label { gap: 7px; }

#jobs-list { margin-top: 14px; display: grid; gap: 8px; }

#jobs-list details { overflow: hidden; border: 1px solid #e1e7ef; border-radius: 9px; background: #fff; }

#jobs-list summary { padding: 12px 14px; color: #35465e; font-size: 12px; line-height: 1.55; cursor: pointer; }

#jobs-list details[open] summary { background: #f7f9fc; border-bottom: 1px solid #e9edf3; }

#jobs-list pre, details pre { margin: 0; padding: 14px; max-height: 420px; overflow: auto; color: #34445a; background: #fbfcfe; font: 11.5px/1.6 "Cascadia Code",Consolas,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.err { font-weight: 550; }

.muted { color: #728198; }



@media (min-width: 901px) {

  .topbar { left: 252px; }

  .topbar .hamb { display: none; }

  .drawer { top: 0; left: 0; width: 252px; height: 100vh; transform: none; }

  .overlay { display: none; }

  body.menu-open .drawer { transform: none; }

  .main { margin-left: 252px; }

}

@media (max-width: 900px) {

  .topbar { left: 0; padding: 0 18px; }

  .drawer { top: var(--h-top); height: calc(100vh - var(--h-top)); }

  .main { margin-left: 0; }

  .container { padding: 25px 22px 44px; }

}

@media (max-width: 640px) {

  :root { --h-top: 62px; }

  .topbar { gap: 9px; padding: 0 12px; }

  .topbar .brand { gap: 7px; font-size: 14px; }

  .topbar .brand-img { width: 26px; height: 26px; }

  .topbar .right { gap: 5px; }

  .topbar .right button { min-height: 36px; padding: 7px 10px; font-size: 12px; }

  .container { padding: 22px 14px 36px; }

  .page-head { margin-bottom: 18px; }

  .page-head h2 { font-size: 23px; }

  .card, .paese-card { padding: 16px; border-radius: 10px; }

  .griglia.tiles { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }

  .tile { min-height: 112px; }

  .tile .num { font-size: 25px; }

  .griglia.due { grid-template-columns: 1fr; }

  .form-row { flex-direction: column; }

  .form-row > label { flex-basis: auto; }

  .toolbar > button { max-width: 100%; }

  .dropzone { padding: 26px 16px; }

  .login { padding: 28px 22px; }

  .paesi-grid { grid-template-columns: 1fr; }

  .paese-card { padding: 17px; }

  .batch-timeline li { grid-template-columns: 1fr; gap: 3px; }

  .dashboard-paesi-grid { grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); }

}

@media (prefers-reduced-motion: reduce) {

  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }

}

@media (prefers-color-scheme: dark) {

  :root:not([data-theme="light"]) {

    --bg: #0c1421; --panel: #131e2e; --panel-2: #182538; --bordo: #2a394d;

    --testo: #e6edf6; --muto: #9aa9bc; --primario: #78a5ff; --primario-2: #9abaff;

    --ok: #59c38d; --no: #ff8a80; --accent: #48c6aa;

    --topbar: #131e2e; --topbar-testo: #e6edf6;

    --drawer: #0a111d; --drawer-testo: #c3cfdd; --drawer-attivo: #1c2c40;

    --ombra: 0 8px 24px rgba(0,0,0,.16);

  }

  :root:not([data-theme="light"]) body { color: var(--testo); }

  :root:not([data-theme="light"]) .topbar { background: rgba(19,30,46,.96); }

  :root:not([data-theme="light"]) input,

  :root:not([data-theme="light"]) select,

  :root:not([data-theme="light"]) .topbar .right .ghost { background: #182538; color: var(--testo); border-color: var(--bordo); }

  :root:not([data-theme="light"]) .page-head h2,

  :root:not([data-theme="light"]) .tile .num,

  :root:not([data-theme="light"]) .paese-card .nm { color: #e6edf6; }

  :root:not([data-theme="light"]) .tile::after { background: #1b2a3f; }

  :root:not([data-theme="light"]) .bar,

  :root:not([data-theme="light"]) .paese-campo-barra { background: #243349; }

  :root:not([data-theme="light"]) .tablewrap,

  :root:not([data-theme="light"]) .batch-table-wrap,

  :root:not([data-theme="light"]) #jobs-list details { background: var(--panel); border-color: var(--bordo); }

  :root:not([data-theme="light"]) thead th { background: #1a293d; color: #aab8ca; }

  :root:not([data-theme="light"]) tbody tr:nth-child(even),

  :root:not([data-theme="light"]) #jobs-list pre,

  :root:not([data-theme="light"]) details pre { background: #111b2a; color: #d4deeb; }

  :root:not([data-theme="light"]) #jobs-list details[open] summary { background: #1a293d; }

  :root:not([data-theme="light"]) .dropzone { background: #121e2e; }

  :root:not([data-theme="light"]) #login { background: radial-gradient(ellipse at 15% 15%,#1b3150 0,transparent 38%),linear-gradient(145deg,#111b2a,#0c1421); }

}

/* ---------- Riepilogo paesi: densità leggibile, senza barre ripetitive ---------- */

.flag-visual {

  position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center;

  width: 36px; height: 27px; overflow: hidden; border: 1px solid #d8e0ea; border-radius: 5px;

  background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.08); vertical-align: middle;

}

.flag-visual .flag-img { display: none; width: 100%; height: 100%; object-fit: cover; }

.flag-fallback { display: inline-block; font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; font-size: 21px; line-height: 1; }

.flag-visual .flag-img.flag-img-loaded { display: block; }

.flag-visual .flag-img.flag-img-loaded + .flag-fallback { display: none; }

.flag-visual .flag-img.flag-img-failed { display: none; }

.barlist .flag-visual { width: 24px; height: 18px; }

.dashboard-paese-flag .flag-visual { width: 36px; height: 27px; }

.paesi-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; width: 100%; }

.paese-card {

  width: 100%; min-width: 0; padding: 0; overflow: hidden; border: 1px solid #dfe6ef;

  border-radius: 12px; background: var(--panel); box-shadow: 0 2px 8px rgba(20,35,55,.045);

}

.country-card-head {

  display: flex; align-items: center; justify-content: space-between; gap: 20px;

  padding: 20px 24px; border-bottom: 1px solid var(--bordo); background: var(--panel);

}

.country-identity { display: flex; align-items: center; gap: 15px; min-width: 0; }

.country-identity .flag-visual { width: 52px; height: 39px; }

.country-name { margin: 0; color: var(--testo); font-size: 21px; line-height: 1.25; font-weight: 720; letter-spacing: -.025em; }

.country-record-total { margin-top: 4px; color: var(--muto); font-size: 13px; font-variant-numeric: tabular-nums; }

.country-coverage-total { flex: 0 0 auto; padding: 6px 10px; border: 1px solid var(--bordo); border-radius: 999px; background: var(--panel-2); color: var(--muto); font-size: 12px; font-weight: 650; }

.paese-copertura { margin: 0; padding: 0 24px; border: 0; }

.paese-copertura summary {

  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 17px 0 11px;

  border-bottom: 1px solid var(--bordo); color: var(--testo); font-size: 14px; font-weight: 680; list-style: none; cursor: pointer;

}

.paese-copertura summary::-webkit-details-marker { display: none; }

.paese-copertura summary::after { content: "⌄"; order: 2; color: var(--muto); font-size: 17px; line-height: 1; }

.paese-copertura:not([open]) summary::after { content: "›"; }

.coverage-caption { margin-left: auto; color: var(--muto); font-size: 12px; font-weight: 450; }

.coverage-table-wrap { width: 100%; overflow-x: auto; }

.coverage-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.coverage-table thead th {

  position: static; padding: 10px 12px; border-bottom: 1px solid var(--bordo); background: transparent;

  color: var(--muto); font-size: 10px; font-weight: 720; letter-spacing: .07em; text-transform: uppercase;

}

.coverage-table thead th:first-child, .coverage-table tbody th { padding-left: 0; text-align: left; }

.coverage-table thead th:not(:first-child), .coverage-table td { text-align: right; }

.coverage-table tbody th, .coverage-table tbody td { padding: 11px 12px; border-bottom: 1px solid color-mix(in srgb, var(--bordo) 68%, transparent); }

.coverage-table tbody tr:last-child th, .coverage-table tbody tr:last-child td { border-bottom: 0; }

.coverage-table tbody th { color: var(--testo); font-weight: 600; white-space: normal; overflow-wrap: anywhere; }

.coverage-table .coverage-count { color: #44536a; font-variant-numeric: tabular-nums; }

.coverage-pct { display: inline-flex; min-width: 66px; justify-content: center; padding: 3px 8px; border: 1px solid #dfe6ee; border-radius: 6px; background: #f6f8fb; color: #45546b; font-size: 12px; font-weight: 680; font-variant-numeric: tabular-nums; }

.coverage-pct.coverage-high { border-color: #cce5d8; background: #f0f8f3; color: #256443; }

.coverage-pct.coverage-medium { border-color: #eadfbe; background: #fbf7eb; color: #78601f; }

.paese-card .azioni { display: flex; gap: 8px; padding: 14px 24px 20px; border-top: 1px solid var(--bordo); }

.paese-card .azioni button { min-height: 36px; padding: 7px 12px; font-size: 12px; }

@media (max-width: 640px) {

  .country-card-head { align-items: flex-start; padding: 16px; }

  .country-identity { gap: 11px; }

  .country-identity .flag-visual { width: 42px; height: 32px; }

  .country-name { font-size: 18px; }

  .paese-copertura { padding: 0 16px; }

  .paese-copertura summary { flex-wrap: wrap; gap: 6px 10px; }

  .coverage-caption { width: 100%; margin-left: 0; order: 3; }

  .coverage-table { min-width: 380px; }

  .paese-card .azioni { padding: 12px 16px 16px; }

}

@media (prefers-color-scheme: dark) {

  :root:not([data-theme="light"]) .paese-card { border-color: var(--bordo); }

  :root:not([data-theme="light"]) .coverage-table tbody th,

  :root:not([data-theme="light"]) .coverage-table .coverage-count { color: var(--testo); }

  :root:not([data-theme="light"]) .coverage-pct { border-color: var(--bordo); background: var(--panel-2); color: var(--testo); }

  :root:not([data-theme="light"]) .coverage-pct.coverage-high { border-color: #315942; background: #182a20; color: #9cdbb4; }

  :root:not([data-theme="light"]) .coverage-pct.coverage-medium { border-color: #5b4d29; background: #2b2619; color: #e2cb86; }

  :root:not([data-theme="light"]) .flag-visual { border-color: #536176; }

}



/* Country overview: fast to scan, with detail fetched only on demand. */

.container { width: min(100% - 48px, 1760px); max-width: 1760px; padding: 30px 0 60px; }

.countries-toolbar {

  position: sticky; top: 68px; z-index: 5; display: flex; align-items: center; gap: 14px;

  margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--bordo); border-radius: 12px;

  background: color-mix(in srgb, var(--panel) 94%, transparent); box-shadow: 0 5px 18px rgba(15,23,42,.06);

  backdrop-filter: blur(12px);

}

.countries-search { flex: 1 1 340px; max-width: 560px; }

.countries-search input { width: 100%; min-height: 42px; padding: 10px 14px; border-radius: 9px; }

.countries-sort { display: flex; align-items: center; gap: 10px; color: var(--muto); font-size: 12px; white-space: nowrap; }

.countries-sort select { min-height: 42px; padding: 8px 32px 8px 12px; border-radius: 9px; }

#paesi-conta { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.paesi-grid { gap: 12px; }

.paese-card { border-color: color-mix(in srgb, var(--bordo) 85%, #9aaabe); border-radius: 14px; box-shadow: 0 2px 6px rgba(20,35,55,.035); transition: border-color .16s ease, box-shadow .16s ease; }

.paese-card:hover { border-color: #b7c5d5; box-shadow: 0 7px 22px rgba(20,35,55,.075); }

.country-card-head { padding: 18px 22px; border: 0; }

.country-identity .flag-visual { width: 48px; height: 36px; }

.country-name { font-size: 19px; letter-spacing: -.015em; }

.country-record-total { font-size: 13px; }

.country-open-details { min-height: 38px; border-radius: 9px; font-size: 12px; font-weight: 650; }

.country-open-details::after { content: "⌄"; margin-left: 9px; font-size: 15px; }

.paese-copertura { padding: 0 22px; border-top: 1px solid var(--bordo); }

.paese-copertura summary { padding: 14px 0; border: 0; }

.paese-copertura summary::after { content: none; }

.coverage-caption { font-size: 12px; }

.coverage-content { padding: 0 0 14px; }

.coverage-table thead th { padding-top: 8px; padding-bottom: 8px; }

.coverage-table tbody th, .coverage-table tbody td { padding-top: 9px; padding-bottom: 9px; }

.coverage-pct { border: 0; background: transparent; }

.coverage-pct.coverage-high, .coverage-pct.coverage-medium { border: 0; background: transparent; }

.coverage-low { color: var(--muto); }

.coverage-loading { display: flex; align-items: center; gap: 10px; min-height: 56px; color: var(--muto); font-size: 13px; }

.spinner { width: 17px; height: 17px; border: 2px solid var(--bordo); border-top-color: #4b6fe8; border-radius: 50%; animation: country-spin .75s linear infinite; }

@keyframes country-spin { to { transform: rotate(360deg); } }

.coverage-error, .dashboard-error { padding: 16px; border: 1px solid #f0c2c2; border-radius: 10px; background: #fff7f7; color: #8b2f35; font-size: 13px; }

.coverage-error button { margin-left: 10px; }

.countries-empty { padding: 28px; text-align: center; color: var(--muto); }

.country-data-warning { margin: 14px 0 4px; padding: 11px 14px; border: 1px solid #ead8a9; border-radius: 10px; background: #fffaf0; color: #735b20; font-size: 12px; line-height: 1.55; }

.dashboard-paesi-card .country-data-warning { margin: 16px 0 0; }

.paese-card .azioni { padding: 12px 22px 16px; border-top: 1px solid var(--bordo); }

@media (max-width: 700px) {

  .container { width: min(100% - 28px, 1760px); padding-top: 20px; }

  .countries-toolbar { position: static; flex-wrap: wrap; padding: 12px; }

  .countries-search { flex-basis: 100%; max-width: none; }

  #paesi-conta { width: 100%; margin: 0; white-space: normal; }

  .country-card-head { align-items: center; gap: 10px; padding: 15px; }

  .country-identity .flag-visual { width: 42px; height: 32px; }

  .country-name { font-size: 17px; }

  .country-open-details { padding: 7px 9px; white-space: nowrap; }

  .paese-copertura { padding: 0 15px; }

  .coverage-caption { width: 100%; margin: 0; }

  .paese-card .azioni { padding: 10px 15px 14px; }

}

:root:not([data-theme="light"]) .coverage-error,

:root:not([data-theme="light"]) .dashboard-error { border-color: #60343b; background: #2b1d22; color: #f0b7bc; }

:root:not([data-theme="light"]) .country-data-warning { border-color: #60512c; background: #282417; color: #e8d193; }



/* Bandiere locali: visibili anche senza CDN e senza font emoji di Windows. */

.flag-visual .flag-img { display:block; }

.flag-visual .flag-fallback { display:none; }

.flag-visual .flag-img.flag-img-failed { display:none; }

.flag-visual .flag-img.flag-img-failed + .flag-fallback { display:inline-block; }



/* Campi paese: colonne raccolte e righe alternate leggibili. */
.coverage-table-wrap { max-width: 920px; border: 1px solid #d6e0ed; border-radius: 10px; overflow-x: auto; }
.coverage-table { width: 100%; min-width: 380px; table-layout: fixed; font-size: 14px; }
.coverage-table thead th { background: #e3ecf8; color: #304765; padding: 12px 16px; font-size: 12px; font-weight: 700; white-space: normal; }
.coverage-table thead th:first-child { width: 50%; padding-left: 16px; }
.coverage-table thead th:nth-child(2) { width: 30%; }
.coverage-table thead th:nth-child(3) { width: 20%; }
.coverage-table tbody th, .coverage-table tbody td { padding: 10px 16px; border-bottom: 1px solid #dce5f0; line-height: 1.45; }
.coverage-table tbody th { padding-left: 16px; font-weight: 550; }
.coverage-table tbody tr:nth-child(odd) { background: #fff; }
.coverage-table tbody tr:nth-child(even) { background: #edf3fb; }
.coverage-table tbody tr:hover { background: #ddeafa; }
.coverage-table .coverage-count { color: #233b59; font-weight: 650; white-space: nowrap; }
.coverage-table .coverage-pct { min-width: 64px; padding: 3px 7px; background: #e1e9f4; color: #334b6d; border-radius: 5px; }
.coverage-table .coverage-pct.coverage-high { background: #dcefe5; color: #205b3e; }
.coverage-table .coverage-pct.coverage-medium { background: #f7eacb; color: #6c5013; }
@media (max-width: 540px) {
 .coverage-table { font-size: 13px; }
 .coverage-table thead th, .coverage-table tbody th, .coverage-table tbody td { padding: 9px 10px; }
 .coverage-table thead th:first-child, .coverage-table tbody th { padding-left: 10px; }
 .coverage-table thead th:first-child { width: 46%; }
 .coverage-table thead th:nth-child(2) { width: 32%; }
 .coverage-table thead th:nth-child(3) { width: 22%; }
 .coverage-table .coverage-pct { min-width: 54px; padding: 3px 5px; }
}
@media (prefers-color-scheme: dark) {
 :root:not([data-theme="light"]) .coverage-table-wrap { border-color: #34465e; }
 :root:not([data-theme="light"]) .coverage-table thead th { background: #253750; color: #dce7f6; }
 :root:not([data-theme="light"]) .coverage-table tbody tr:nth-child(odd) { background: #142033; }
 :root:not([data-theme="light"]) .coverage-table tbody tr:nth-child(even) { background: #1e2e45; }
 :root:not([data-theme="light"]) .coverage-table tbody tr:hover { background: #2b405d; }
 :root:not([data-theme="light"]) .coverage-table tbody th,
 :root:not([data-theme="light"]) .coverage-table tbody td { border-color: #34465e; }
 :root:not([data-theme="light"]) .coverage-table .coverage-count { color: #e1eaf7; }
 :root:not([data-theme="light"]) .coverage-table .coverage-pct { background: #30445f; color: #dde7f7; }
 :root:not([data-theme="light"]) .coverage-table .coverage-pct.coverage-high { background: #254a39; color: #b6edce; }
 :root:not([data-theme="light"]) .coverage-table .coverage-pct.coverage-medium { background: #514326; color: #f2dca4; }
}

/* Tutte le righe della griglia paesi hanno la stessa altezza. */
.dashboard-paesi-grid { grid-auto-rows: 1fr; }
.dashboard-paese { height: 100%; min-height: 88px; }
.dashboard-paese-nome { line-height: 1.35; }
.sample-dialog { width: min(1440px, 96vw); max-width: 96vw; max-height: 90vh; padding: 22px; border: 1px solid var(--bordo); border-radius: 14px; background: var(--panel); color: var(--testo); box-shadow: 0 24px 80px #0005; }
.sample-dialog::backdrop { background: #10203899; }
.sample-dialog-head, .sample-dialog-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sample-dialog-head { justify-content: space-between; }
.sample-dialog-head h3 { margin: 0; display: flex; align-items: center; gap: 10px; }
.sample-dialog #campione-info { margin: 14px 0; line-height: 1.5; }
.sample-preview { max-height: 60vh; overflow: auto; }
.sample-preview th { position: sticky; top: 0; z-index: 1; }
.sample-preview td { min-width: 130px; max-width: 360px; overflow-wrap: anywhere; white-space: pre-wrap; vertical-align: top; }
.sample-preview tbody tr:nth-child(even) { background: var(--panel-2); }
.sample-dialog-actions { padding-top: 16px; }
.sample-dialog-actions #campione-csv { margin-left: auto; }
@media (max-width: 600px) { .sample-dialog { padding: 14px; } .sample-dialog-actions #campione-csv { width: 100%; margin-left: 0; } }

.dashboard-country-controls { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.dashboard-country-controls .countries-sort { display:flex; align-items:center; gap:8px; margin:0; }
.dashboard-country-controls select { min-width:190px; }
.dashboard-paesi-head { flex-wrap:wrap; gap:14px; }
@media (max-width:600px) { .dashboard-country-controls { width:100%; } .dashboard-country-controls .countries-sort { flex:1; } .dashboard-country-controls select { min-width:0; flex:1; } }

/* Paesi consecutivi: una sola riga di identita e azioni. */
.paesi-grid { gap:8px; }
.paese-card { border-radius:9px; }
.paese-card .country-card-head { padding:12px 16px; min-height:68px; }
.paese-card .country-identity { gap:12px; }
.paese-card .country-identity > div { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 14px; }
.paese-card .country-name { margin:0; font-size:17px; }
.paese-card .country-record-total { margin:0; white-space:nowrap; }
.paese-card .country-identity .flag-visual { width:40px; height:30px; }
.country-row-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.paese-card .country-row-actions .azioni { display:flex; align-items:center; gap:8px; padding:0; margin:0; border:0; }
.country-row-actions button { white-space:nowrap; min-height:36px; }
.paese-card .paese-copertura:not([open]) { border:0; padding:0; }
.paese-card .paese-copertura summary { display:none; }
.paese-card .paese-copertura[open] { padding:16px; border-top:1px solid var(--bordo); }
@media (max-width:760px) {
 .paese-card .country-card-head { flex-wrap:wrap; }
 .country-row-actions { width:100%; flex-wrap:wrap; }
 .paese-card .country-name { font-size:16px; }
}

.country-search-panel { padding:18px; border-top:1px solid var(--bordo); background:var(--panel-2); }
.country-search-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; }
.country-search-head h3 { margin:0 0 5px; font-size:17px; }
.country-search-head p { margin:0; color:var(--muto); font-size:13px; }
.country-search-panel .card { padding:16px; }
.country-search-panel .tablewrap { max-height:65vh; overflow:auto; }
.country-search-open[aria-expanded="true"] { border-color:var(--primario); color:var(--primario); }
@media(max-width:640px) { .country-search-panel { padding:12px; } .country-search-head { flex-wrap:wrap; } }

+.sample-preview .sample-group-head th { top:0; z-index:4; height:32px; padding:7px 12px; border-right:2px solid var(--bordo); font-weight:750; text-align:left; }
+.sample-preview .sample-field-head th { top:32px; z-index:3; background:var(--panel); }
+.sample-preview .sample-group-head .sample-type-0 { background:#e4edfb; color:#23426c; }
+.sample-preview .sample-group-head .sample-type-1 { background:#dff1e7; color:#21583b; }
+.sample-preview .sample-group-head .sample-type-2 { background:#fff0d5; color:#70541b; }
+.sample-preview .sample-group-head .sample-type-3 { background:#eee6fa; color:#584071; }
+.sample-preview .sample-group-head .sample-type-4 { background:#dff1f4; color:#22555d; }
+.sample-preview .sample-group-head .sample-type-5 { background:#f4e4e9; color:#754153; }
+