/* CRM HR — stile essenziale, leggibile, veloce. Nessuna dipendenza esterna. */
:root {
  --bg: #F6F7F9; --surface: #FFFFFF; --surface-2: #F1F3F6; --border: #E3E6EB; --border-strong: #CDD2DA;
  --text: #161B26; --text-2: #4A5465; --text-3: #7A8496;
  --primary: #3B4FD8; --primary-600: #2F40B8; --primary-50: #EEF0FD;
  --success: #12805C; --success-50: #E7F6EF; --warn: #A15C07; --warn-50: #FDF3E3;
  --danger: #C2253B; --danger-50: #FCEBEE; --info: #1F6FB2; --info-50: #E8F2FB; --accent: #7A3FC7; --accent-50: #F3ECFC;
  --radius: 10px; --radius-sm: 7px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.12);
  --sidebar: 248px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
svg { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 620; }
p { margin: 0 0 .75em; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- layout ---- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; font-weight: 700; font-size: 15px; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 9px); gap: 3px; }
.brand-mark i { width: 9px; height: 9px; border-radius: 3px; display: block; }
.brand-mark i:nth-child(1) { background: #2563EB; } .brand-mark i:nth-child(2) { background: #DC2626; }
.brand-mark i:nth-child(3) { background: #111827; } .brand-mark i:nth-child(4) { background: #16A34A; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--text-3); }
.nav { padding: 6px 10px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 14px 10px 6px; }
.nav a, .nav span.soon { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 520; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--primary-50); color: var(--primary-600); }
.nav span.soon { color: var(--text-3); cursor: default; }
.nav span.soon em { margin-left: auto; font-style: normal; font-size: 10.5px; border: 1px solid var(--border); border-radius: 99px; padding: 0 7px; }
.nav svg { width: 17px; height: 17px; flex: none; }
.user-box { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-50); color: var(--primary-600); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; }
.user-box .who { min-width: 0; flex: 1; }
.user-box .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-box .who span { font-size: 12px; color: var(--text-3); }
.user-actions { display: flex; gap: 4px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(246,247,249,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 10px 28px; min-height: 58px; }
.topbar .spacer { flex: 1; }
.content { padding: 24px 28px 48px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.menu-toggle { position: absolute; opacity: 0; pointer-events: none; }
.scrim { display: none; }
.app > .sidebar { grid-column: 1; grid-row: 1; }
.app > .main { grid-column: 2; grid-row: 1; }

/* ---- selettore società ---- */
.scope { position: relative; }
.scope summary { list-style: none; display: inline-flex; align-items: center; gap: 9px; padding: 7px 12px 7px 10px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 99px; cursor: pointer; font-weight: 600; box-shadow: var(--shadow); }
.scope summary::-webkit-details-marker { display: none; }
.scope summary .caret { color: var(--text-3); font-size: 11px; }
.scope[open] summary { border-color: var(--primary); }
.scope-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; }
.scope-menu form { margin: 0; }
.scope-menu button { width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 9px 10px; border-radius: var(--radius-sm); font: inherit; cursor: pointer; color: var(--text); }
.scope-menu button:hover { background: var(--surface-2); }
.scope-menu button.current { background: var(--primary-50); font-weight: 600; }
.scope-menu .sep { border-top: 1px solid var(--border); margin: 6px 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.scope-label { font-size: 12px; color: var(--text-3); }

/* ---- componenti ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 18px 20px; }
.card-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + * { margin-top: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-danger { color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 32px; padding: 0; height: 32px; }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12.5px; color: var(--text-3); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], select, textarea {
  font: inherit; height: 38px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; color: var(--text); width: 100%; }
input[type=color] { height: 38px; width: 64px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, summary:focus-visible { outline: 3px solid rgba(59,79,216,.22); border-color: var(--primary); outline-offset: 0; }
.code-input { font-size: 24px !important; letter-spacing: .35em; text-align: center; height: 52px !important; font-family: ui-monospace, Menlo, monospace; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 99px; cursor: pointer; background: #fff; font-weight: 550; }
.check:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.check input { accent-color: var(--primary); margin: 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 320px; }
.toolbar select { width: auto; min-width: 170px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBFC; }
.table tr.clickable { cursor: pointer; }
.table .name { font-weight: 600; color: var(--text); }
.table .sub { font-size: 12.5px; color: var(--text-3); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge.info { background: var(--info-50); color: var(--info); }
.badge.success { background: var(--success-50); color: var(--success); }
.badge.warn { background: var(--warn-50); color: var(--warn); }
.badge.danger { background: var(--danger-50); color: var(--danger); }
.badge.accent { background: var(--accent-50); color: var(--accent); }
.badge.demo { background: #FFF7D6; color: #8A6100; border: 1px dashed #E3C35C; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border: 1px solid var(--border); border-radius: 99px; font-size: 12.5px; font-weight: 550; background: #fff; margin: 2px 4px 2px 0; }

.flash { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid; font-weight: 520; }
.flash.success { background: var(--success-50); border-color: #B6E2CF; color: #0B5A41; }
.flash.error { background: var(--danger-50); border-color: #F2BCC5; color: #8E1528; }
.flash.warning { background: var(--warn-50); border-color: #F1D29E; color: #7A4504; }
.flash.info { background: var(--info-50); border-color: #BBD7F0; color: #154E80; }
.errors { margin: 0 0 14px; padding: 11px 14px 11px 32px; background: var(--danger-50); border: 1px solid #F2BCC5; border-radius: var(--radius-sm); color: #8E1528; }

.stat { padding: 16px 18px; }
.stat .k { font-size: 12.5px; color: var(--text-2); font-weight: 560; }
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.stat .s { font-size: 12px; color: var(--text-3); }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 190px 1fr 44px; gap: 12px; align-items: center; font-size: 13px; }
.funnel-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.funnel-bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; min-width: 2px; }
.funnel-row b { text-align: right; }
.empty { text-align: center; padding: 34px 20px; color: var(--text-2); }
.empty svg { width: 34px; height: 34px; color: var(--text-3); margin-bottom: 8px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.list-plain li:last-child { border-bottom: 0; }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; margin: 0; }
dl.kv dt { color: var(--text-3); font-size: 13px; }
dl.kv dd { margin: 0; font-weight: 550; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.pager .btns { display: flex; gap: 6px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs span { padding: 9px 14px; color: var(--text-3); font-weight: 560; white-space: nowrap; }
.tabs span.active { color: var(--primary-600); border-bottom: 2px solid var(--primary); }
.tabs span em { font-style: normal; font-size: 10.5px; border: 1px solid var(--border); border-radius: 99px; padding: 0 6px; margin-left: 4px; }
.diff { font-size: 12px; }
.diff .before { color: var(--danger); text-decoration: line-through; }
.diff .after { color: var(--success); }
.secret-box { font-family: ui-monospace, Menlo, monospace; font-size: 18px; letter-spacing: .08em; padding: 14px; background: var(--surface-2); border-radius: var(--radius-sm); text-align: center; user-select: all; word-break: break-all; }
.company-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.company-tile { width: 100%; text-align: left; font: inherit; cursor: pointer; display: flex; gap: 12px; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
.company-tile:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.company-tile .sw { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 750; font-size: 14px; flex: none; }
.company-tile b { display: block; font-size: 15px; }
.company-tile span { font-size: 12.5px; color: var(--text-3); }

/* ---- pagine di accesso ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 10% -10%, #E6E9FB 0, transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 410px; }
.auth-card .card-body { padding: 28px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-weight: 700; font-size: 16px; }
.auth h1 { margin-bottom: 6px; }
.auth .lead { color: var(--text-2); margin-bottom: 20px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-3); }

/* ---- responsive ---- */
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .app > .main { grid-column: 1; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 50; transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow-lg); }
  .menu-toggle:checked ~ .sidebar { transform: none; }
  .menu-toggle:checked ~ .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(16,24,40,.35); z-index: 40; }
  .menu-btn { display: inline-flex !important; }
  .topbar { padding: 10px 14px; }
  .content { padding: 16px 14px 40px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .funnel-row { grid-template-columns: 130px 1fr 36px; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 8px; }
}
.menu-btn { display: none; }
@media (max-width: 560px) { .grid-4 { grid-template-columns: 1fr 1fr; } .stat .v { font-size: 22px; } }

/* ---- dashboard direzione ---- */
.period-nav { display: inline-flex; align-items: center; gap: 6px; }
.period-nav .current { font-weight: 650; min-width: 150px; text-align: center; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.seg a { padding: 6px 12px; color: var(--text-2); font-weight: 560; font-size: 13px; border-right: 1px solid var(--border); }
.seg a:last-child { border-right: 0; }
.seg a:hover { background: var(--surface-2); text-decoration: none; }
.seg a.on { background: var(--primary-50); color: var(--primary-600); }
.kpi-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.kpi-bar i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.kpi-bar i.over { background: var(--danger); }
.kpi-bar i.ok { background: var(--success); }
.co-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.co-card { border-top: 4px solid var(--c, var(--primary)); }
.co-card .card-head { border-bottom: 0; padding-bottom: 4px; }
.co-card h2 { display: flex; align-items: center; gap: 8px; }
.metric { padding: 10px 20px; border-top: 1px solid var(--border); }
.metric .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.metric .lbl { font-size: 12.5px; color: var(--text-2); font-weight: 560; }
.metric .val { font-weight: 700; font-size: 17px; }
.metric .val small { font-weight: 520; color: var(--text-3); font-size: 12.5px; }
.metric .foot { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--border-strong); background: var(--surface-2); }
.trend { display: grid; grid-template-columns: 120px repeat(6, 1fr); gap: 4px 10px; align-items: end; font-size: 12.5px; }
.trend .bars { display: flex; align-items: flex-end; gap: 2px; height: 56px; }
.trend .bars i { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.trend .mlabel { text-align: center; color: var(--text-3); }
.trend .co { display: flex; align-items: center; gap: 6px; font-weight: 600; align-self: center; }
.trend .cell { text-align: center; }
.trend .cell b { display: block; font-size: 13px; }
.plan-input { max-width: 130px; text-align: right; }
.note { font-size: 12.5px; color: var(--text-3); margin-top: 10px; }

/* ---- agenda ---- */
.legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.legend a { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border-strong); background: #fff; color: var(--text); font-weight: 600; font-size: 13px; }
.legend a:hover { text-decoration: none; border-color: var(--text-3); }
.legend a.off { opacity: .45; text-decoration: line-through; }
.legend a em { font-style: normal; font-weight: 520; color: var(--text-3); }
.cal { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.cal-head { padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.cal-head b { display: block; font-size: 18px; color: var(--text); font-weight: 650; }
.cal-head.today b { background: var(--primary); color: #fff; border-radius: 99px; width: 32px; height: 32px; line-height: 32px; margin: 0 auto; }
.cal-corner { border-bottom: 1px solid var(--border); }
.cal-hours { position: relative; }
.cal-hours span { display: block; text-align: right; padding-right: 8px; font-size: 11.5px; color: var(--text-3); transform: translateY(-7px); }
.cal-col { position: relative; border-left: 1px solid var(--border); background-image: linear-gradient(var(--border) 1px, transparent 1px); }
.cal-col.weekend { background-color: #FAFBFC; }
.ev { position: absolute; border-radius: 6px; padding: 3px 6px; font-size: 11.5px; line-height: 1.25; overflow: hidden; color: var(--text); border-left: 3px solid; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.ev:hover { text-decoration: none; z-index: 5; box-shadow: var(--shadow-lg); }
.ev b { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { display: block; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.cancelled { opacity: .5; text-decoration: line-through; }
.ev.group b::before { content: "👥 "; }
.now-line { position: absolute; left: 0; right: 0; border-top: 2px solid var(--danger); z-index: 4; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.month .dh { padding: 8px; font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; border-bottom: 1px solid var(--border); text-align: center; }
.month .day { min-height: 112px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; }
.month .day:nth-child(7n+1) { border-left: 0; }
.month .day.out { background: #FAFBFC; color: var(--text-3); }
.month .day .n { font-size: 12.5px; font-weight: 650; margin-bottom: 4px; display: inline-block; }
.month .day.today .n { background: var(--primary); color: #fff; border-radius: 99px; padding: 0 7px; }
.chip-ev { display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 5px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); border-left: 3px solid; }
.chip-ev:hover { text-decoration: none; }
.agenda-list .dayhead { padding: 10px 16px; background: var(--surface-2); font-weight: 650; border-bottom: 1px solid var(--border); }
.agenda-list .item { display: flex; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text); align-items: center; }
.agenda-list .item:hover { background: #FAFBFC; text-decoration: none; }
.agenda-list .time { font-variant-numeric: tabular-nums; font-weight: 650; width: 92px; flex: none; }
.agenda-list .bar { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
.only-mobile { display: none; }
@media (max-width: 860px) {
  .only-desktop { display: none !important; }
  .only-mobile { display: block; }
  .trend { grid-template-columns: 90px repeat(6, 1fr); gap: 4px; }
}

/* ---- affiancamenti ---- */
.days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.day-card.current { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,79,216,.12); }
.day-card.att-present { border-top: 4px solid var(--success); }
.day-card.att-absent { border-top: 4px solid var(--danger); }
.day-card.att-postponed { border-top: 4px solid var(--warn); }
.dayform, .fbform { margin-top: 14px; }
.choice { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.choice label { flex: 1; min-width: 80px; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; text-align: center; padding: 10px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-weight: 650; background: #fff; }
.choice input:checked + span { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.choice input:focus-visible + span { outline: 3px solid rgba(59,79,216,.22); }
.small-choice label { min-width: 40px; }
.small-choice span { padding: 7px 0; }
.f-reason, .f-newdate, .f-ko { display: none; }
.dayform:has(input[value=absent]:checked) .f-reason,
.dayform:has(input[name=continues][value=no]:checked) .f-reason { display: flex; }
.dayform:has(input[value=postponed]:checked) .f-newdate { display: flex; }
.dayform:has(input[value=absent]:checked) .f-continues,
.dayform:has(input[value=postponed]:checked) .f-continues { display: none; }
.fbform:has(input[value=negative]:checked) .f-ko { display: flex; }
.ratings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; margin-bottom: 8px; }
.rating .label { display: block; margin-bottom: 4px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 700; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.dots i.att-present { background: var(--success-50); color: var(--success); border-color: #B6E2CF; }
.dots i.att-absent { background: var(--danger-50); color: var(--danger); border-color: #F2BCC5; }
.dots i.att-postponed { background: var(--warn-50); color: var(--warn); border-color: #F1D29E; }
.table td.flag { background: var(--danger-50); color: var(--danger); font-weight: 700; }
.issues li { align-items: flex-start; }
.issue-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); margin-top: 6px; flex: none; }
.issue-dot.warn { background: var(--warn); }
.bell { position: relative; }
.bell .count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
button.item { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; border-bottom: 1px solid var(--border); }
.item.notif.unread { background: var(--primary-50); }
@media (max-width: 860px) { .days { grid-template-columns: 1fr; } .ratings { grid-template-columns: 1fr; } }

.analysis-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
@media (max-width: 1200px) { .analysis-split { grid-template-columns: 1fr; } }
textarea { font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; resize: vertical; }
.hr-notes { margin-top: 6px; padding: 12px 14px; background: var(--warn-50); border: 1px solid #F1D29E; border-radius: var(--radius-sm); white-space: pre-line; }
.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.upload-row input[type=file] { font: inherit; max-width: 320px; }
.ko-row form { display: contents; }
.phase-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.phase-chips label { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; padding: 3px 9px; border: 1px solid var(--border-strong); border-radius: 99px; cursor: pointer; background: #fff; }
.phase-chips label:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); font-weight: 600; }
.phase-chips input { margin: 0; accent-color: var(--primary); }

/* ---- area candidati per annuncio ---- */
.ws-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.ws-title { font-size: 24px; display: inline; }
.posting-switch summary { border: 0; box-shadow: none; padding: 0; background: none; gap: 10px; }
.posting-switch[open] summary { border: 0; }
.menu-link { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text); }
.menu-link:hover { background: var(--surface-2); text-decoration: none; }
.menu-link.current { background: var(--primary-50); font-weight: 600; }
.ws-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pop-right .scope-menu { left: auto; right: 0; }
.form-pop { width: 360px; padding: 14px !important; }
.form-pop .field { margin-bottom: 10px; }
.ws-tools summary.btn, .quick summary { list-style: none; }
.ws-tools summary.btn::-webkit-details-marker, .quick summary::-webkit-details-marker { display: none; }
.ws { display: grid; grid-template-columns: 290px minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.ws-list { position: sticky; top: 74px; max-height: calc(100vh - 90px); display: flex; flex-direction: column; overflow: hidden; }
.ws-filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; border-bottom: 1px solid var(--border); }
.ws-filters a { font-size: 12.5px; padding: 4px 9px; border-radius: 99px; color: var(--text-2); border: 1px solid var(--border); background: #fff; font-weight: 560; }
.ws-filters a:hover { text-decoration: none; border-color: var(--border-strong); }
.ws-filters a.on { background: var(--primary-50); border-color: var(--primary); color: var(--primary-600); }
.ws-filters em { font-style: normal; color: var(--text-3); margin-left: 2px; }
.ws-search { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ws-items { overflow-y: auto; }
.ws-item { display: flex; flex-direction: column; gap: 1px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); border-left: 3px solid transparent; }
.ws-item:hover { background: #FAFBFC; text-decoration: none; }
.ws-item.current { background: var(--primary-50); border-left-color: var(--primary); }
.ws-item b { font-size: 14.5px; }
.ws-item span { font-size: 13px; color: var(--text-2); }
.ws-item .sub { font-size: 12px; color: var(--text-3); }
.cv-dot { font-style: normal; display: inline-block; font-size: 10px !important; font-weight: 700; color: var(--primary-600) !important; background: var(--primary-50); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.ws-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 24px 24px; min-width: 0; }
.ws-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13.5px; }
.ws-nav .spacer { flex: 1; }
.ws-person { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.ws-name { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.quick { display: flex; border: 1px solid var(--border-strong); border-radius: 12px; flex: none; }
.quick form { margin: 0; }
.qbtn { display: grid; place-items: center; width: 56px; height: 48px; font-size: 20px; font-weight: 700; background: #fff; border: 0; border-right: 1px solid var(--border); cursor: pointer; color: var(--text); font-family: inherit; }
.quick > :first-child .qbtn { border-radius: 11px 0 0 11px; }
.quick details:last-child .qbtn { border-right: 0; border-radius: 0 11px 11px 0; }
.qbtn:hover { background: var(--surface-2); }
.q-valid:hover { color: var(--success); background: var(--success-50); }
.q-pause:hover { color: var(--warn); background: var(--warn-50); }
.q-reject:hover, .quick details[open] .q-reject { color: var(--danger); background: var(--danger-50); }
.ws-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 6px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.ws-section { padding: 16px 0; border-bottom: 1px solid var(--border); }
.ws-section:last-child { border-bottom: 0; }
.ws-section h3 { font-size: 17px; margin-bottom: 10px; }
.qa { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.qa span { border-left: 3px solid var(--primary-50); padding-left: 10px; color: var(--text-2); }
.cv-frame { width: 100%; height: 720px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.ws-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 74px; }
.ws-status { padding: 14px 16px; }
.ws-status .label { display: block; margin-bottom: 8px; font-size: 14px; }
.ws-status .f-ko { display: none; }
.ws-status:has(option[value=ko]:checked) .f-ko, .ws-status:has(option[value=cv_rejected]:checked) .f-ko { display: flex; }
.feed { list-style: none; margin: 14px 0 0; padding: 0; max-height: 52vh; overflow-y: auto; }
.feed li { display: flex; flex-direction: column; gap: 1px; padding: 10px 0 10px 14px; border-left: 2px solid var(--border); position: relative; font-size: 13px; }
.feed li::before { content: ""; position: absolute; left: -5px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.feed li.k-note::before { background: var(--warn); }
.feed li.k-status::before { background: var(--primary); }
.feed li.k-doc::before, .feed li.k-received::before { background: var(--success); }
.feed .when { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.feed .detail { color: var(--text-2); white-space: pre-line; }
.feed .who { font-size: 11.5px; color: var(--text-3); }
@media (max-width: 1280px) { .ws { grid-template-columns: 260px minmax(0, 1fr); } .ws-side { grid-column: 2; position: static; } }
@media (max-width: 860px) { .ws { grid-template-columns: 1fr; } .ws-list { position: static; max-height: 340px; } .ws-side { grid-column: 1; } .ws-name { font-size: 24px; } .cv-frame { height: 480px; } }
.content:has([data-ws]) { max-width: none; }
.form-pop .btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---- ricerca per telefono ---- */
.topsearch { position: relative; flex: 1; max-width: 420px; margin-left: 6px; }
.topsearch input { padding-left: 36px; padding-right: 58px; height: 38px; border-radius: 99px; background: var(--surface); }
.topsearch .ico, .big-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); display: flex; }
.topsearch kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 600 11px var(--font); color: var(--text-3); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; background: var(--surface-2); }
.big-search { position: relative; display: flex; gap: 10px; max-width: 640px; margin-bottom: 18px; }
.big-search input { height: 50px; font-size: 18px; padding-left: 42px; letter-spacing: .02em; }
.big-search .btn { height: 50px; padding: 0 22px; }
.phone-hit { font-size: 13.5px; white-space: nowrap; }
.phone-hit mark { background: #FFF1A8; color: inherit; border-radius: 3px; padding: 0 1px; }
@media (max-width: 860px) { .topsearch { max-width: none; } .topsearch input { padding-right: 12px; } }
.search-icon { display: none !important; }
@media (max-width: 600px) {
  .topsearch { display: none; }
  .search-icon { display: inline-flex !important; }
  .agenda-list .item { flex-wrap: wrap; }
  .agenda-list .item > span[style*="flex:1"] { flex: 1 1 calc(100% - 24px) !important; }
  .phone-hit { margin-left: 16px; }
}

/* ruoli (posizioni) */
.ws-roles { background: #FAFBFC; }
.role-tag { font-style: normal; font-size: 11px; font-weight: 600; color: #5B21B6; background: #F3E8FF; border-radius: 4px; padding: 1px 5px; }
.badge.role { background: #F3E8FF; color: #5B21B6; border-color: #E9D5FF; }
.inline-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.inline-form select { min-width: 200px; padding: 5px 8px; }

/* target HR */
.tbar { position: relative; height: 10px; border-radius: 99px; background: #EEF1F5; overflow: visible; margin: 8px 0 4px; }
.tbar i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.tbar b { position: absolute; top: -3px; width: 3px; height: 16px; border-radius: 2px; background: #111827; transform: translateX(-1px); }
.tbar.tb-done i, .tbar.tb-ok i { background: #16A34A; }
.tbar.tb-risk i { background: #D97706; }
.tbar.tb-low i { background: #DC2626; }
.tstate { font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: #EEF1F5; color: var(--text-2); white-space: nowrap; }
.tstate.s-done, .tstate.s-ok { background: #DCFCE7; color: #166534; }
.tstate.s-risk { background: #FEF3C7; color: #92400E; }
.tstate.s-low { background: #FEE2E2; color: #991B1B; }
.target-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tcard .big { font-size: 34px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.tcard .big small { font-size: 17px; color: var(--text-3); font-weight: 600; }
.tcard .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 12px; }
.tcard .facts div { font-size: 12.5px; color: var(--text-3); }
.tcard .facts b { display: block; font-size: 16px; color: var(--text); }
.tcard .sep { border-top: 1px dashed var(--border); margin: 14px 0 10px; }
.tcard .lbl { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 650; }
.tmini { min-width: 140px; }
.tmini .tbar { margin: 4px 0 0; height: 7px; }

/* WhatsApp */
.btn-wa { background: #25D366; border-color: #1EBE5A; color: #fff; display: inline-flex; gap: 6px; align-items: center; list-style: none; }
.btn-wa:hover { background: #1EBE5A; color: #fff; }
.wa-menu > summary::-webkit-details-marker { display: none; }
.wa-pop { min-width: 320px; max-width: 380px; padding: 8px; }
.scope-menu .wa-opt { display: flex; align-items: flex-start; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; font: inherit; color: var(--text); }
.scope-menu .wa-opt:hover { background: #F0FDF4; }
.scope-menu .wa-opt span { font-size: 12px; color: var(--text-3); line-height: 1.35; }
.wa-menu form { margin: 0; }
.scope.wa-menu > summary.btn-wa { background: #25D366; border-color: #1EBE5A; color: #fff; box-shadow: none; padding: 8px 14px; gap: 6px; font-size: 14px; }
.scope.wa-menu > summary.btn-wa:hover { background: #1EBE5A; }
.scope.wa-menu[open] > summary.btn-wa { border-color: #15803D; }
@media (max-width: 600px) { .wa-pop { min-width: 0; width: min(340px, calc(100vw - 40px)); } }

/* tipo di colloquio */
.iv-menu > summary { list-style: none; }
.iv-menu > summary::-webkit-details-marker { display: none; }
.scope.iv-menu > summary.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: none; padding: 8px 14px; font-size: 14px; }
.iv-pop { min-width: 330px; padding: 8px; }
.scope-menu .iv-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; width: 100%; text-align: left; background: none; border: 0; font: inherit; cursor: pointer; }
.scope-menu .iv-opt:hover { background: var(--surface-2); text-decoration: none; }
.scope-menu .iv-opt span { font-size: 12px; color: var(--text-3); }
.iv-head { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 4px 10px; }
.iv-badge { display: inline-block; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 99px; text-decoration: none; margin: 6px 0 2px; }
.iv-badge.iv-group { background: #FEF3C7; color: #92400E; }
.iv-badge.iv-individual { background: #E0F2FE; color: #075985; }
.iv-badge:hover { text-decoration: none; filter: brightness(.97); }
