/* Identità visiva ripresa da ruthinium.it: azzurro #0095db, carattere Rubik. */
@font-face {
  font-family: "Rubik"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("fonts/rubik-latin-ext.15c3dca723cb.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Rubik"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("fonts/rubik-latin.b65daadded74.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --brand: #0095db;
  --brand-dark: #0078b4;
  --brand-deep: #005f90;
  --brand-soft: #e5f4fc;
  --brand-line: #a9d9f3;
  --page: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --ink: #1c2730;
  --ink-2: #56626d;
  --muted: #8a949e;
  --line: #dde4ea;
  --line-strong: #c3ced8;
  --accent: var(--brand);
  --accent-hover: var(--brand-dark);
  --accent-text: var(--brand-dark);
  --accent-soft: var(--brand-soft);
  --good: #0ca30c;
  --good-text: #006300;
  --good-soft: #e9f7e9;
  --critical: #d03b3b;
  --critical-dark: #b53030;
  --critical-soft: #fdecec;
  --warning-soft: #fff5dc;
  --warning-line: #fab219;
  --series-1: #0095db;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28, 39, 48, .06), 0 2px 6px rgba(28, 39, 48, .04);
  --shadow-lift: 0 6px 18px rgba(0, 120, 180, .16);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 15px/1.45 "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 23px; font-weight: 600; margin: 0 0 4px; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
p { margin: 0 0 12px; }
strong, b, th { font-weight: 600; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* --- barra superiore --- */
.topbar {
  background: var(--surface); border-top: 4px solid var(--brand); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px 22px; flex-wrap: wrap; padding: 10px 22px;
  box-shadow: 0 1px 3px rgba(28, 39, 48, .05);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink-2); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { height: 36px; width: auto; display: block; }
.brand span { font-weight: 500; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; padding-left: 12px; border-left: 1px solid var(--line-strong); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a, .nav summary {
  padding: 7px 11px; border-radius: 8px; color: var(--ink); font-weight: 500; cursor: pointer; list-style: none;
  white-space: nowrap;
}
.nav summary::-webkit-details-marker { display: none; }
.nav a:hover, .nav summary:hover { background: var(--surface-2); text-decoration: none; }
.nav a.on, .nav details.on > summary { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav details { position: relative; }
.nav .menu {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(28, 39, 48, .14); display: grid;
}
.nav-sep { width: 1px; background: var(--line); margin: 4px 6px; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); }
.who button { background: none; border: 0; padding: 0; color: var(--accent-text); cursor: pointer; font: inherit; }
.who button:hover { text-decoration: underline; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex: none;
  object-fit: cover; vertical-align: middle;
}
.avatar.sm { width: 24px; height: 24px; font-size: 11.5px; }
.avatar.lg { width: 52px; height: 52px; font-size: 22px; }
.avatar.xl { width: 84px; height: 84px; font-size: 34px; }
.profile-head { display: flex; align-items: center; gap: 16px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 22px 60px; }
.wrap.narrow { max-width: 720px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 0; }

/* --- componenti --- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font: inherit; font-weight: 500; padding: 8px 14px; border-radius: 8px; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { color: var(--critical); border-color: #e9b4b4; }
.btn.danger:hover { background: var(--critical-soft); }
.btn.stop { background: var(--critical); border-color: var(--critical); color: #fff; font-weight: 600; }
.btn.stop:hover { background: var(--critical-dark); border-color: var(--critical-dark); }
.btn.stop::before { content: ""; width: 12px; height: 12px; border-radius: 2px; background: currentColor; }
.btn.big { padding: 13px 24px; font-size: 16px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.chip.accent { background: var(--brand-soft); color: var(--brand-deep); }
.chip.warn { background: var(--warning-soft); color: #6b4a00; }

.messages { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.messages li { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.messages li.success { background: var(--good-soft); border-color: #bfe5bf; color: var(--good-text); }
.messages li.error { background: var(--critical-soft); border-color: #f0c2c2; color: #8f1f1f; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
td.r, th.r { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
tr.inactive td { color: var(--muted); }
tr.clickable:hover td { background: var(--surface-2); }
.table-scroll { overflow-x: auto; }
.empty { padding: 26px 10px; text-align: center; color: var(--ink-2); }

/* --- form --- */
label { font-weight: 500; font-size: 13.5px; display: block; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date],
input[type=time], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 149, 219, .2); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.field { margin-bottom: 14px; }
.field .help { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.field .errorlist, .errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--critical); font-size: 13px; }
.field.check label { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.field.check input { width: auto; }
.field ul { list-style: none; padding: 0; margin: 0; }
.checks > div, .checks ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 14px; }
.checks label { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; }
.checks input { width: auto; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; }
.form-error { background: var(--critical-soft); border: 1px solid #f0c2c2; color: #8f1f1f; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.form-error ul { list-style: none; margin: 0; padding: 0; }

/* --- accesso --- */
body.auth { background: linear-gradient(180deg, var(--brand) 0, var(--brand-dark) 300px, var(--page) 300px); min-height: 100vh; }
.login { max-width: 420px; margin: 7vh auto 0; padding: 0 20px; }
.login.wide { max-width: 780px; }
.login-card { background: var(--surface); border-radius: 16px; padding: 30px 28px 26px; box-shadow: 0 12px 40px rgba(0, 60, 95, .22); }
.login-logo { display: block; height: 52px; width: auto; margin: 0 auto 6px; }
.login .app-name { text-align: center; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; margin-bottom: 22px; }
.login .sub { text-align: center; color: var(--ink-2); margin-bottom: 18px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.person {
  font: inherit; cursor: pointer; padding: 14px 10px; border-radius: var(--radius); text-align: center;
  border: 1px solid var(--line-strong); background: var(--surface); display: grid; justify-items: center; gap: 6px;
}
.person .avatar { width: 72px; height: 72px; font-size: 28px; }
.person strong { display: block; font-size: 16px; }
.person span.dep { font-size: 12.5px; color: var(--ink-2); }
.person:hover { border-color: var(--brand); box-shadow: var(--shadow-lift); }
.person.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.pin-box { max-width: 260px; margin: 20px auto 0; text-align: center; }
.pin-box input { text-align: center; font-size: 26px; letter-spacing: .4em; }

/* --- timer dipendente --- */
.identity { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.identity h1 { margin: 0; font-size: 27px; font-weight: 500; }
.identity h1 b { font-weight: 700; }
.identity .date { margin-left: auto; color: var(--ink-2); }
.now {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; align-items: center;
  border-left: 5px solid var(--line-strong);
}
.now.running { border: 0; color: #fff; background: linear-gradient(90deg, var(--brand-deep), var(--brand-dark) 45%, var(--brand)); box-shadow: var(--shadow-lift); padding: 22px 24px; }
.now .state { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.now.running .state, .now.running .meta, .now.running .meta a, .now.running .note { color: #fff; }
.now.running .meta a { text-decoration: underline; }
.now.running .chip { background: rgba(255, 255, 255, .22); color: #fff; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #5fe08a; box-shadow: 0 0 0 0 rgba(95, 224, 138, .7); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(95, 224, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(95, 224, 138, 0); } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
.now .what { font-size: 24px; font-weight: 600; line-height: 1.25; margin: 4px 0 8px; }
.now .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--ink-2); font-size: 14px; }
.clock { font-size: 44px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; text-align: right; }
.now .side { display: grid; gap: 12px; justify-items: end; }
.now.running .btn { background: #fff; border-color: #fff; color: var(--critical-dark); }
.now.running .btn:hover { background: var(--critical-soft); }
@media (max-width: 620px) {
  .now { grid-template-columns: 1fr; }
  .now .side { justify-items: start; }
  .clock { text-align: left; }
}
.section-title { font-size: 12.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); margin: 24px 0 10px; }
.acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.acts form { display: contents; }
.act {
  font: inherit; font-weight: 500; font-size: 16.5px; line-height: 1.25; text-align: center; cursor: pointer;
  min-height: 150px; padding: 18px 14px 16px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.act .ico {
  width: 68px; height: 68px; border-radius: 20px; flex: none; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark); transition: background .12s, color .12s;
}
.act .ico .icon { width: 38px; height: 38px; }
.act .txt { display: flex; flex-direction: column; gap: 3px; }
.act:hover:not(:disabled) { border-color: var(--brand); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.act:hover:not(:disabled) .ico { background: var(--brand); color: #fff; }
.act:active:not(:disabled) { transform: translateY(0); }
.act small { font-weight: 400; font-size: 12.5px; color: var(--ink-2); }
.act.current { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); }
.act.current .ico { background: var(--brand); color: #fff; }
.act:disabled { cursor: not-allowed; color: var(--muted); box-shadow: none; background: var(--surface-2); }
.act:disabled .ico { background: var(--line); color: var(--muted); }
.act.current:disabled { color: var(--ink); background: var(--brand-soft); }
.act.current:disabled .ico { background: var(--brand); color: #fff; }
.lock-hint { margin: 18px 0 -10px; color: var(--ink-2); font-size: 13.5px; }
.stale { background: var(--warning-soft); border-color: var(--warning-line); }
.stale form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-top: 10px; }
.stale input { width: 130px; }

/* Attività in corso: pagina oscurata e riquadro centrale con il timer. */
.running-overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; overflow: auto;
  background: rgba(14, 26, 36, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.running-card {
  width: min(480px, 100%); background: var(--surface); border-radius: 18px; overflow: hidden; text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45); animation: pop .18s ease-out;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .running-card { animation: none; } }
.running-card .head { background: linear-gradient(135deg, var(--brand-deep), var(--brand-dark) 55%, var(--brand)); color: #fff; padding: 22px 24px 24px; }
.running-card .who-line { font-size: 13.5px; opacity: .95; margin-bottom: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.running-card .who-line .avatar { background: rgba(255, 255, 255, .25); box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }
.running-card .state { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.running-card .what { font-size: 26px; font-weight: 600; line-height: 1.2; margin: 8px 0 10px; }
.running-card .chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.running-card .head .chip { background: rgba(255, 255, 255, .22); color: #fff; font-size: 13.5px; padding: 3px 12px; white-space: normal; }
.running-card .note { font-size: 13.5px; margin-top: 10px; opacity: .95; }
.running-card .body { padding: 22px 24px 20px; }
.running-card .clock { text-align: center; font-size: 60px; color: var(--ink); }
.running-card .since { color: var(--ink-2); margin: 6px 0 20px; }
.running-card .foot { display: flex; justify-content: center; gap: 6px 18px; flex-wrap: wrap; padding: 13px 20px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; }
.running-card .foot button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; }
.running-card .foot button:hover { text-decoration: underline; }

.day-total { display: flex; align-items: baseline; gap: 8px; }
.day-total strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.week a, .week span {
  display: block; text-align: center; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 13px;
}
.week a:hover { border-color: var(--brand); text-decoration: none; }
.week .on { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.week .off { color: var(--muted); background: transparent; }
.week b { display: block; font-variant-numeric: tabular-nums; min-height: 1.45em; }

/* --- dialog attività --- */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 24px 70px rgba(0, 0, 0, .4); color: var(--ink); }
dialog::backdrop { background: rgba(14, 26, 36, .6); }
dialog .body { padding: 22px; }
dialog h2 { font-size: 20px; margin-bottom: 16px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; padding: 16px 12px; border-radius: 10px; font-weight: 600; font-size: 16px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface);
}
.seg span:hover { border-color: var(--brand); background: var(--brand-soft); }
.seg input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.suggest { position: relative; }
.suggest-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(28, 39, 48, .14);
  max-height: 220px; overflow: auto;
}
.suggest-list button { display: block; width: 100%; text-align: left; font: inherit; padding: 8px 10px; border: 0; background: none; cursor: pointer; }
.suggest-list button:hover, .suggest-list button.on { background: var(--brand-soft); }
.suggest-hint { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; min-height: 1.4em; }
.recent { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.recent button { font: inherit; font-size: 12.5px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.recent button:hover { background: var(--brand-soft); border-color: var(--brand); }
.kiosk-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--ink); color: #fff; padding: 10px 20px; display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; z-index: 60; }
.kiosk-bar button { font: inherit; background: #fff; color: var(--ink); border: 0; border-radius: 6px; padding: 5px 12px; cursor: pointer; font-weight: 500; }

/* --- gestione: filtri, tile, grafici --- */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; align-items: end; }
.filters .field { margin: 0; }
.filters label { font-size: 12.5px; color: var(--ink-2); }
.period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.period .tabs { display: flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.period .tabs a { padding: 6px 12px; color: var(--ink-2); border-right: 1px solid var(--line); }
.period .tabs a:last-child { border-right: 0; }
.period .tabs a.on { background: var(--brand); color: #fff; font-weight: 600; }
.period .tabs a:hover { text-decoration: none; }
.period .label { font-weight: 600; font-size: 17px; min-width: 150px; text-align: center; }
.period .spacer { flex: 1; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin: 16px 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .k { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.tile .v { font-size: 28px; font-weight: 600; line-height: 1.2; margin-top: 2px; }
.tile .s { font-size: 12.5px; color: var(--ink-2); }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.s1 { background: var(--series-1); } .s2 { background: var(--series-2); }
.s3 { background: var(--series-3); } .s4 { background: var(--series-4); }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.charts .card + .card { margin-top: 0; }
.charts .wide { grid-column: 1 / -1; }
.card h2 small { font-weight: 400; color: var(--ink-2); font-size: 13px; margin-left: 6px; }
.card .q { color: var(--ink-2); font-size: 13px; margin: -8px 0 12px; }
.bars { display: grid; gap: 2px; }
.bar-row {
  display: grid; grid-template-columns: minmax(110px, 34%) 1fr auto; gap: 10px; align-items: center;
  padding: 5px 6px; border-radius: 6px; color: var(--ink);
}
a.bar-row:hover { background: var(--surface-2); text-decoration: none; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.bar-row .track { height: 14px; display: flex; gap: 2px; }
.bar-row .fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row .fill.s2 { background: var(--series-2); }
.bar-row .track .fill:not(:last-child) { border-radius: 0; }
.bar-row .val { font-variant-numeric: tabular-nums; font-size: 13.5px; white-space: nowrap; text-align: right; min-width: 92px; }
.bar-row .val span { color: var(--muted); font-size: 12.5px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-box { position: relative; height: 240px; }
details.table-view { margin-top: 10px; font-size: 13px; }
details.table-view summary { cursor: pointer; color: var(--ink-2); }
details.table-view td, details.table-view th { padding: 5px 8px; }

.live { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.live > div { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.live strong { display: block; }
.live .t { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; }
.diff { font-size: 13px; }
.diff del { color: var(--critical); text-decoration-thickness: 1px; }
.diff ins { color: var(--good-text); text-decoration: none; font-weight: 600; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input[type=text], .inline-form select { width: auto; min-width: 180px; padding: 5px 8px; }
.projects .inline-form { flex-wrap: nowrap; }
.projects input[name=name] { min-width: 230px; }
.projects select { min-width: 0 !important; max-width: 190px; }
.projects th, .projects td { padding-left: 7px; padding-right: 7px; vertical-align: middle; }

@media (max-width: 620px) {
  .topbar { padding: 8px 14px; }
  .brand img { height: 30px; }
  .nav { flex: 1 1 100%; order: 3; }
  .who { margin-left: auto; }
  .who .name { display: none; }
  .wrap { padding: 16px 14px 70px; }
  .identity h1 { font-size: 23px; }
  .identity .date { margin-left: 0; flex-basis: 100%; }
  .acts { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .act { font-size: 15px; padding: 14px 10px; min-height: 128px; gap: 10px; }
  .act .ico { width: 56px; height: 56px; border-radius: 16px; }
  .act .ico .icon { width: 32px; height: 32px; }
  .clock { font-size: 36px; }
  .running-card .clock { font-size: 50px; }
  .running-card .what { font-size: 22px; }
}

.running-card:focus { outline: none; }
@media (min-width: 900px) {
  .topbar { flex-wrap: nowrap; gap: 8px 16px; }
  .nav { flex-wrap: nowrap; }
  .nav a, .nav summary { padding: 7px 9px; font-size: 14.5px; }
}
@media (max-width: 1150px) { .brand span { display: none; } }

/* --- calendario --- */
.cal { display: grid; gap: 4px; }
.cal-head, .cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) 64px; gap: 4px; }
.cal-head div { text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: 4px 0 6px; }
.cal-day {
  min-height: 96px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; position: relative;
}
a.cal-day:hover { border-color: var(--brand); text-decoration: none; box-shadow: var(--shadow-lift); }
.cal-day.out { border-color: transparent; background: transparent; }
.cal-day.future { background: transparent; border-style: dashed; color: var(--muted); }
.cal-day.weekend { background: var(--surface-2); }
.cal-day.has { background: var(--brand-soft); border-color: var(--brand-line); }
.cal-day.today .n { background: var(--brand); color: #fff; }
.cal-day.selected { border-color: var(--brand-dark); box-shadow: inset 0 0 0 2px var(--brand-dark); }
.cal-day .n { font-size: 12.5px; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; margin: -1px 0 0 -3px; }
.cal-day .tot { position: absolute; top: 7px; right: 9px; font-weight: 600; font-size: 15px; color: var(--brand-deep); }
.cal-day .ln { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--ink-2); line-height: 1.35; }
.cal-day .ln i { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-day .ln b { font-weight: 500; flex: none; }
.cal-day .ln.more { color: var(--muted); }
.cal-day.wk { min-height: 0; border: 0; background: transparent; align-items: center; justify-content: center; font-weight: 600; color: var(--ink-2); font-size: 13.5px; }
.cal-head .wk { color: var(--muted); }
input[type=file] { font: inherit; font-size: 13.5px; }
@media (max-width: 720px) {
  .cal-head, .cal-row { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .cal-head .wk, .cal-day.wk { display: none; }
  .cal-day { min-height: 58px; padding: 4px; align-items: center; }
  .cal-day .n { margin: 0; }
  .cal-day .tot { position: static; font-size: 12.5px; }
  .cal-day .ln { display: none; }
}

.field ul:not(.errorlist) { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
/* Con il menu completo dell'amministratore il nome accanto alla foto toglierebbe spazio a «Esci». */
@media (max-width: 1380px) { .who .name { display: none; } }

/* --- parcheggio di un'attività --- */
.chip.park { background: #fff1e6; color: #8a3d0b; }
.park-btn { margin-top: 10px; }
.parked-box { text-align: left; background: #fff7ef; border: 1px solid #f6d3b4; border-left: 4px solid var(--series-2); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.parked-box .k { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8a3d0b; margin-bottom: 2px; }
.park-banner { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #fff7ef; border-color: #f6d3b4; border-left: 4px solid var(--series-2); margin-bottom: 8px; }
