/* People Hub 2.0 — progetto generato dallo Scaffolder
 * Design system "classico" People Hub (TA Corner · HR Dashboard): Plus Jakarta Sans, topbar + sidebar bianca,
 * card bianche su fondo caldo, accent coral (pubblico dipendenti) o celeste (tool admin). */
:root {
  --accent: #FF6B7C; --accent-ink: #E85568; --accent-light: #fff0f1; --accent-border: rgba(255,107,124,.25); --accent-rgb: 255,107,124;
  --bg: #f9f7f5; --white: #ffffff;
  --t1: #1c1917; --t2: #6b6562; --t3: #b5b0ab;
  --b1: #ede9e5; --b2: #d9d4cf;
  --sidebar-w: 230px; --sidebar-mini: 52px; --header-h: 56px;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px;
  --shadow: 0 2px 12px rgba(28,25,23,.06);
  --ok: #1E7A45; --ok-soft: rgba(22,163,74,.1); --warn: #B07A00; --warn-soft: #FEF3DC; --poor: #B02A2A;
  --font: 'Plus Jakarta Sans', system-ui, sans-serif; --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  /* alias usati dal codice (compatibilità) */
  --coral: var(--accent); --coral-ink: var(--accent-ink); --coral-deep: var(--accent-ink); --coral-soft: var(--accent-light); --coral-chip: var(--accent-light);
  --ink: var(--t1); --black: var(--t1); --muted: var(--t2); --grey1: var(--b2); --grey2: var(--t3); --grey3: var(--t3); --grey4: var(--t2); --grey5: var(--t1);
  --line: var(--b1); --line-2: var(--b1); --line-3: var(--b1); --bg-low: var(--bg); --bg-mid: #f1ede9; --sans: var(--font); --serif: var(--font);
}
[data-theme="blue"] { --accent: #5476FF; --accent-ink: #3D5BE0; --accent-light: #eef2ff; --accent-border: rgba(84,118,255,.25); --accent-rgb: 84,118,255; }

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { background: var(--bg); color: var(--t1); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; cursor: pointer; }
a:hover { color: var(--accent-ink); }
code { font-family: var(--mono); font-size: .9em; background: var(--bg); border: 1px solid var(--b1); border-radius: 6px; padding: 1px 5px; }
.sr { position: absolute; left: -9999px; }
.hidden { display: none !important; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes aoDot { 0%,80%,100% { opacity: .3; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.sk { background: var(--b1); border-radius: var(--r-md); animation: pulse 1.4s ease-in-out infinite; }

/* ── LOADING (prima del boot) ── */
.loading { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lo-logo { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.lo-track { width: 240px; height: 2px; background: var(--b1); border-radius: 2px; overflow: hidden; }
.lo-fill { height: 100%; width: 40%; background: var(--accent); border-radius: 2px; animation: loSlide 1.2s ease-in-out infinite; }
@keyframes loSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.lo-label { font-size: 13px; color: var(--t2); margin-top: 18px; }
.lo-dots { display: flex; gap: 6px; margin-top: 16px; }
.lo-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .3; animation: aoDot 1.2s ease-in-out infinite; }
.lo-dots i:nth-child(2) { animation-delay: .2s; } .lo-dots i:nth-child(3) { animation-delay: .4s; }

/* ── TOPBAR ── */
.app { display: flex; flex-direction: column; height: 100vh; }
body.has-dev .app { height: calc(100vh - 42px); }
.topbar { height: var(--header-h); background: var(--white); display: flex; align-items: center; gap: 0; padding: 0 24px; border-bottom: 1px solid var(--b1); box-shadow: var(--shadow); flex-shrink: 0; position: relative; z-index: 50; }
.sb-toggle { width: 32px; height: 32px; background: none; border: 1px solid var(--b1); border-radius: var(--r-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--t2); font-size: 16px; margin-right: 14px; flex-shrink: 0; transition: all .15s; }
.sb-toggle:hover { background: var(--bg); color: var(--t1); border-color: var(--b2); }
.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; background: none; border: none; }
.logo-circle { width: 34px; height: 34px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; color: #fff; flex-shrink: 0; letter-spacing: -.02em; }
.logo-name { font-size: 15px; font-weight: 700; color: var(--t1); letter-spacing: -.02em; white-space: nowrap; }
.logo-name span { color: var(--accent); }
.topbar-div { width: 1px; height: 22px; background: var(--b1); margin: 0 18px; flex-shrink: 0; }
.topbar-crumb { font-size: 13px; color: var(--t2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--b1); border-radius: 20px; padding: 5px 12px 5px 8px; flex-shrink: 0; }
.topbar-avatar, .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-light); border: 1px solid var(--accent-border); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.topbar-greeting { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.role-chip { font-size: 10px; font-weight: 700; color: var(--accent); background: var(--accent-light); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
@media (max-width: 700px) { .topbar { padding: 0 12px; } .topbar-div, .topbar-crumb, .topbar-greeting { display: none; } }

/* ── SHELL + SIDEBAR ── */
.shell { display: flex; flex: 1; min-height: 0; }
.side { width: var(--sidebar-w); background: var(--white); border-right: 1px solid var(--b1); flex-shrink: 0; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; padding: 16px 0; transition: width .25s cubic-bezier(.4,0,.2,1); }
.side::-webkit-scrollbar { width: 3px; } .side::-webkit-scrollbar-thumb { background: var(--b2); border-radius: 2px; }
.nav-group { margin-bottom: 4px; display: flex; flex-direction: column; }
.nav-group + .nav-group { border-top: 1px solid var(--b1); margin-top: 6px; padding-top: 8px; }
.nav-label { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--t3); padding: 6px 18px 4px; white-space: nowrap; }
.nav-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 18px; font-size: 13px; font-weight: 500; color: var(--t2); background: none; border: none; cursor: pointer; text-align: left; position: relative; white-space: nowrap; transition: all .15s; }
.nav-btn:hover { color: var(--t1); background: var(--bg); }
.nav-btn.on { color: var(--accent); background: var(--accent-light); font-weight: 600; }
.nav-btn.on::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; background: var(--accent); border-radius: 0 3px 3px 0; }
.sb-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sb-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-btn .soon { font-size: 9px; font-weight: 700; color: var(--accent); background: var(--accent-light); border-radius: 99px; padding: 1px 6px; }
.nav-btn.dim { opacity: .55; }
.nav-add { color: var(--accent); font-weight: 600; font-size: 12.5px; }
.nbadge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.edit-toggle { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; position: relative; padding: 9px 18px; font-size: 13px; font-weight: 500; color: var(--t2); background: none; border: none; cursor: pointer; white-space: nowrap; }
.edit-toggle:hover { background: var(--bg); color: var(--t1); }
.switch { margin-left: auto; width: 30px; height: 18px; border-radius: 99px; background: var(--b2); position: relative; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.edit-toggle.on .switch { background: var(--accent); } .edit-toggle.on .switch::after { transform: translateX(12px); }
.app.side-mini .side { width: var(--sidebar-mini); }
.app.side-mini .nav-label, .app.side-mini .sb-text, .app.side-mini .nav-btn .soon, .app.side-mini .switch { display: none; }
.app.side-mini .nav-btn, .app.side-mini .edit-toggle { padding: 9px 0; justify-content: center; }
.app.side-mini .nbadge { position: absolute; top: 3px; right: 6px; min-width: 9px; width: 9px; height: 9px; padding: 0; font-size: 0; }
.app.side-mini .nav-btn:hover::after { content: attr(data-label); position: absolute; left: calc(var(--sidebar-mini) - 2px); top: 50%; transform: translateY(-50%); background: var(--t1); color: #fff; font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: var(--r-sm); white-space: nowrap; pointer-events: none; z-index: 200; }
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { width: 100% !important; flex-direction: row; flex-wrap: wrap; padding: 8px; border-right: none; border-bottom: 1px solid var(--b1); gap: 2px; }
  .nav-group, .nav-group + .nav-group { flex-direction: row; flex-wrap: wrap; border: none; margin: 0; padding: 0; }
  .nav-label { display: none; }
  .nav-btn, .edit-toggle { width: auto; padding: 7px 12px; border-radius: var(--r-sm); }
  .nav-btn.on::before { display: none; }
  .sb-toggle { display: none; }
}

/* ── CONTENUTO ── */
.main { flex: 1; min-width: 0; overflow-y: auto; background: var(--bg); padding: 28px 32px 56px; display: flex; flex-direction: column; gap: 20px; animation: pageIn .22s ease; }
.main::-webkit-scrollbar { width: 5px; } .main::-webkit-scrollbar-thumb { background: var(--b2); border-radius: 3px; }
@media (max-width: 600px) { .main { padding: 18px 14px 40px; } }
.body { display: flex; flex-direction: column; gap: 20px; }

/* hero (Home) */
.hero { position: relative; background: var(--white); border: 1px solid var(--b1); border-radius: var(--r-xl); padding: 32px 38px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; }
.chip, .hero-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-light); color: var(--accent); font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--accent-border); margin-bottom: 12px; letter-spacing: .02em; }
.hero h1 { font-size: 28px; font-weight: 800; letter-spacing: -.04em; line-height: 1.15; margin-bottom: 8px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 14px; color: var(--t2); line-height: 1.7; max-width: 520px; }
.hero-vis { width: 92px; height: 92px; background: var(--accent-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 40px; border: 2px solid var(--accent-border); flex-shrink: 0; }
.hero-fb { margin-top: 16px; }
@media (max-width: 700px) { .hero { grid-template-columns: 1fr; padding: 24px; } .hero-vis { display: none; } }

/* intestazione pagina */
.page-head .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .mono, .mono-tag { display: inline-flex; background: var(--accent-light); color: var(--accent); font-family: var(--font); font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--accent-border); margin-bottom: 8px; letter-spacing: .04em; text-transform: uppercase; }
.page-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.04em; margin-bottom: 4px; }
.page-head p { font-size: 13px; color: var(--t2); line-height: 1.6; max-width: 640px; }
.head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-head .l { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mono { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--t3); }
.sec-title { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.sec-title.sans { font-size: 14px; }

/* news banner */
.nbanner { display: flex; align-items: center; gap: 12px; padding: 11px 16px; font-size: 13px; border-radius: var(--r-md); border: 1px solid var(--accent-border); animation: fadeUp .3s ease both; }
.nb-lbl { font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; flex-shrink: 0; }
.nb-t { flex: 1; min-width: 0; line-height: 1.45; }
.nb-more { border: none; background: none; font-weight: 700; font-size: 13px; cursor: pointer; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.nb-x { border: none; background: none; cursor: pointer; font-size: 12px; opacity: .55; color: inherit; padding: 4px; }
.nb-x:hover { opacity: 1; }
.nb-new { background: var(--accent-light); } .nb-new .nb-lbl { background: var(--accent); color: #fff; }
.nb-info { background: var(--t1); color: #fff; border-color: var(--t1); } .nb-info .nb-lbl { background: rgba(255,255,255,.15); color: #fff; }
.nb-warning { background: var(--warn-soft); color: #5A3000; border-color: #F5D99A; } .nb-warning .nb-lbl { background: #FFD9A0; color: #5A3000; }

/* card / panel */
.panel, .card-box { background: var(--white); border: 1px solid var(--b1); border-radius: var(--r-lg); padding: 20px 24px; min-width: 0; }
.panel h4 { font-size: 14px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 14px; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.placeholder { background: var(--white); border: 1px dashed var(--b2); border-radius: var(--r-lg); padding: 36px; text-align: center; color: var(--t2); font-size: 13.5px; line-height: 1.6; }
.placeholder .ph-ic { font-size: 40px; margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.kv > div { background: var(--bg); border: 1px solid var(--b1); border-radius: var(--r-sm); padding: 10px 12px; min-width: 0; }
.kv span { display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--t3); margin-bottom: 3px; }
.kv b { font-size: 13px; font-weight: 600; word-break: break-word; }
.ok-line { font-size: 14px; margin-bottom: 12px; }
.dev-hint { border-style: dashed; }
.prose { font-size: 14px; line-height: 1.7; color: var(--t1); max-width: 780px; }
.answer { font-size: 13.5px; line-height: 1.65; color: var(--t1); }
.answer p + p { margin-top: 8px; }
.answer img { max-width: 100%; border-radius: var(--r-sm); margin: 10px 0; display: block; }
.answer a { text-decoration: underline; }
.callout { border-radius: var(--r-lg); padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; border: 1px solid var(--b1); }
.callout h3 { font-size: 17px; font-weight: 800; letter-spacing: -.03em; }
.callout-soft { background: var(--white); }
.callout-accent { background: var(--accent); border-color: var(--accent); color: #fff; } .callout-accent .answer { color: #fff; } .callout-accent .btn { background: #fff; border-color: #fff; color: var(--accent); }
.callout-dark { background: var(--t1); border-color: var(--t1); color: #fff; } .callout-dark .answer { color: #e7e3df; } .callout-dark .btn { background: var(--accent); border-color: var(--accent); color: #fff; }

/* liste di link e card */
.ch-list { display: flex; flex-direction: column; border: 1px solid var(--b1); border-radius: var(--r-lg); overflow: hidden; background: var(--white); }
.ch-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; font-size: 13px; color: var(--t1); background: none; border: none; text-align: left; cursor: pointer; width: 100%; }
.ch-list > * + * { border-top: 1px solid var(--b1); }
.ch-row:hover { background: var(--bg); } .ch-row small { color: var(--t2); font-size: 11.5px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 20px; border-radius: var(--r-lg); border: 1px solid var(--b1); background: var(--white); cursor: pointer; color: var(--t1); transition: all .2s; animation: fadeUp .3s ease both; }
.card:hover { border-color: var(--accent-border); box-shadow: 0 4px 20px rgba(var(--accent-rgb),.1); transform: translateY(-2px); }
.card[aria-disabled="true"] { cursor: default; transform: none; box-shadow: none; }
.card-ic { font-size: 26px; margin-bottom: 4px; }
.card b { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.card span:last-child { font-size: 13px; color: var(--t2); line-height: 1.55; }

/* bottoni */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--b1); background: var(--white); color: var(--t2); transition: all .15s; letter-spacing: -.01em; white-space: nowrap; }
.btn:hover { border-color: var(--b2); color: var(--t1); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); transform: translateY(-1px); }
.btn.dark { background: var(--t1); border-color: var(--t1); color: #fff; }
.btn.danger { color: var(--poor); border-color: #F3C9C9; } .btn.danger:hover { background: #FDECEC; }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.link-btn { background: none; border: none; color: var(--accent); font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--accent-ink); }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 8px; padding: 4px 9px; cursor: pointer; color: var(--t2); font-size: 12px; font-weight: 600; }
.icon-btn:hover { border-color: var(--b1); background: var(--bg); color: var(--t1); }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; vertical-align: middle; }
.btn:not(.primary) .spinner { border-color: var(--b1); border-top-color: var(--accent); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { padding: 6px 14px; border-radius: 99px; border: 1.5px solid var(--b1); background: var(--white); font-size: 12px; font-weight: 600; color: var(--t2); cursor: pointer; transition: all .15s; }
.pill:hover { border-color: var(--accent-border); color: var(--accent); }
.pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* form */
.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 11px; font-weight: 700; color: var(--t2); letter-spacing: .04em; text-transform: uppercase; }
.field input, .field select, .field textarea, .search input, select.sel { padding: 10px 13px; border: 1.5px solid var(--b1); border-radius: var(--r-sm); font-size: 13px; background: var(--bg); outline: none; transition: border-color .15s; color: var(--t1); width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus, select.sel:focus { border-color: var(--accent); background: var(--white); }
.field textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
select.sel { width: auto; padding: 7px 12px; background: var(--white); cursor: pointer; }
.hint { font-size: 11.5px; color: var(--t3); line-height: 1.5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row2, .row3 { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin: 4px 16px 4px 0; color: var(--t1); }
.check input { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; }
.msg { font-size: 12px; color: var(--poor); min-height: 16px; margin-top: 6px; }
.preview { background: var(--bg); border: 1px solid var(--b1); border-radius: var(--r-sm); padding: 6px 14px 12px; margin-top: 8px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.count { font-size: 12px; color: var(--t3); }

/* tabelle */
.tbl-wrap { background: var(--white); border: 1px solid var(--b1); border-radius: var(--r-lg); overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--t3); padding: 10px 18px; text-align: left; background: var(--bg); white-space: nowrap; }
.tbl td { padding: 12px 18px; font-size: 13px; border-top: 1px solid var(--b1); vertical-align: top; }
.tbl tr:hover td { background: #fdfcfb; }
.tbl tr.inactive td { opacity: .45; }
.tbl .id { font-family: var(--mono); font-size: 11px; color: var(--t3); }
.tbl .clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .actions { white-space: nowrap; text-align: right; }
.unread-row td { background: var(--accent-light); }
.badge-s { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-s::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-s.on { background: var(--ok-soft); color: #15803d; } .badge-s.off { background: var(--bg); color: var(--t3); } .badge-s.star { background: rgba(217,119,6,.1); color: #b45309; }

/* admin */
.admin-tabs { display: flex; gap: 6px; margin-top: 16px; overflow-x: auto; }
.admin-tabs button { padding: 6px 14px; border-radius: 99px; font-size: 12px; font-weight: 700; cursor: pointer; border: 1.5px solid var(--b1); background: var(--white); color: var(--t2); white-space: nowrap; transition: all .15s; }
.admin-tabs button:hover { border-color: var(--accent-border); color: var(--accent); }
.admin-tabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* page builder (Edit mode) */
.col-top { gap: 16px; }
.blk { position: relative; min-width: 0; }
.blk-bar { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; padding: 5px 6px 5px 10px; border-radius: var(--r-sm); background: var(--white); border: 1px dashed var(--accent); font-size: 11.5px; color: var(--t2); }
.blk-handle { cursor: grab; color: var(--t3); letter-spacing: -2px; margin-right: 4px; }
.blk-name { flex: 1; min-width: 0; font-weight: 700; color: var(--t1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk-name i { font-style: normal; font-weight: 500; color: var(--t3); }
.blk-bar button { padding: 3px 8px; border-radius: 7px; border: 1px solid var(--b1); background: var(--white); font-size: 11.5px; font-weight: 600; cursor: pointer; color: var(--t2); }
.blk-bar button:hover { border-color: var(--accent); color: var(--accent); }
.blk.dragging { opacity: .4; }
.blk.drop-before::before { content: ''; display: block; height: 3px; border-radius: 2px; background: var(--accent); margin: -10px 0 8px; }
.col.drop-col { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: var(--r-md); }
.add-zone { width: 100%; padding: 12px; border-radius: var(--r-md); border: 1.5px dashed var(--b2); background: transparent; color: var(--t2); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.add-zone:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.is-hidden { opacity: .45; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pick { text-align: left; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--b1); background: var(--white); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.pick:hover { border-color: var(--accent-border); background: var(--accent-light); }
.pick b { font-size: 13.5px; } .pick span { font-size: 12px; color: var(--t2); line-height: 1.45; }

/* feedback + dev notes */
.fb-btns { display: flex; align-items: center; gap: 10px; }
.fb-btns .nbadge { margin-left: 6px; }
.fb-plus { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 21px; line-height: 1; cursor: pointer; box-shadow: 0 3px 10px rgba(var(--accent-rgb),.35); display: inline-flex; align-items: center; justify-content: center; padding-bottom: 2px; }
.fb-plus:hover { background: var(--accent-ink); }
.note-row { width: 100%; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--b1); background: var(--white); cursor: pointer; margin-bottom: 8px; }
.note-row.unread { border-color: var(--accent-border); background: var(--accent-light); }
.nr-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; } .nr-top span { font-weight: 400; color: var(--t2); }
.nr-text { font-size: 12.5px; color: var(--t2); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; padding: 4px 2px; }
.bubble { align-self: flex-start; max-width: 85%; background: var(--bg); border: 1px solid var(--b1); border-radius: 14px 14px 14px 4px; padding: 9px 12px; font-size: 13px; line-height: 1.5; }
.bubble.mine { align-self: flex-end; background: var(--accent-light); border-color: var(--accent-border); border-radius: 14px 14px 4px 14px; }
.bubble .who { font-size: 10.5px; color: var(--t3); margin-bottom: 3px; }
.howto { display: flex; flex-direction: column; gap: 12px; max-width: 860px; }
.how-step { display: flex; gap: 16px; padding: 18px 20px; border: 1px solid var(--b1); border-radius: var(--r-lg); background: var(--white); }
.how-n { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; background: var(--t1); color: #fff; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.how-step h2 { font-size: 15px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.how-step p { font-size: 13px; line-height: 1.65; color: var(--t2); }

/* email template */
.em-prev { background: var(--white); border: 1px solid var(--b1); border-radius: var(--r-sm); padding: 12px 14px; margin-top: 4px; }
.em-subj { font-weight: 700; font-size: 13.5px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--b1); }

/* settings */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.set-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--b1); border-radius: var(--r-lg); background: var(--white); min-width: 0; }
.set-card.wide { grid-column: 1 / -1; border-color: var(--accent-border); background: var(--accent-light); }
.set-ic { font-size: 22px; flex-shrink: 0; }
.set-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.set-t b { font-size: 13.5px; }
.set-t code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; background: var(--white); }
.set-a { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
@media (max-width: 600px) { .set-grid { grid-template-columns: 1fr; } .set-card { flex-wrap: wrap; } }

/* gate (sessione scaduta / privato / errore) */
.gate { max-width: 420px; margin: 12vh auto; background: var(--white); border: 1px solid var(--b1); border-radius: var(--r-xl); padding: 40px 44px; text-align: center; box-shadow: 0 8px 40px rgba(28,25,23,.06); }
.gate.inline { margin: 40px auto; }
.gate-ic { font-size: 40px; margin-bottom: 16px; }
.gate h1 { font-size: 20px; font-weight: 800; letter-spacing: -.04em; margin-bottom: 8px; }
.gate p { font-size: 13px; color: var(--t2); line-height: 1.7; margin-bottom: 18px; }
.gate p:last-child { margin-bottom: 0; }
.error-box { max-width: 420px; margin: 12vh auto; background: var(--white); border: 1px solid var(--b1); border-radius: var(--r-xl); padding: 32px; text-align: center; font-size: 13px; color: var(--t2); line-height: 1.7; }

/* dev mode */
.dev-banner { position: sticky; top: 0; z-index: 60; height: 42px; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; overflow-x: auto; background: #1A1A2E; color: #00C48C; font-size: 12px; padding: 0 18px; }
.dv-t { font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.dv-v { color: rgba(255,255,255,.65); white-space: nowrap; }
.dv-r { color: #f4d56d; font-size: 11px; white-space: nowrap; }
.dev-banner input { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 5px 10px; color: #fff; font-size: 12px; width: 230px; outline: none; flex-shrink: 0; }
.dv-btn { border: none; border-radius: 8px; padding: 6px 12px; font-size: 12px; cursor: pointer; background: rgba(255,255,255,.1); color: #fff; font-weight: 600; white-space: nowrap; }
.dv-btn.primary { background: #5476FF; }
.dv-x { margin-left: auto; background: transparent; color: rgba(255,255,255,.5); border: none; font-size: 15px; cursor: pointer; padding: 0 4px; }
.dev-tab { display: none; position: fixed; bottom: 14px; left: 14px; z-index: 60; width: 32px; height: 32px; border-radius: 8px; border: none; background: #1A1A2E; color: #00C48C; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.25); }

/* modal + toast */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(28,25,23,.45); backdrop-filter: blur(3px); align-items: flex-start; justify-content: center; padding: 32px 16px; overflow-y: auto; }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: var(--r-xl); padding: 28px 28px 22px; width: 100%; max-width: 480px; position: relative; animation: fadeUp .22s ease; box-shadow: 0 24px 60px rgba(28,25,23,.18); }
.modal.wide { max-width: 740px; }
.modal-close { position: absolute; top: 16px; right: 18px; background: none; border: none; cursor: pointer; font-size: 16px; color: var(--t3); padding: 4px; }
.modal h3 { font-size: 17px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 4px; padding-right: 24px; }
.modal .sub-t { font-size: 12px; color: var(--t3); margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--b1); flex-wrap: wrap; }
.modal-actions .left { margin-right: auto; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--t1); color: #fff; font-size: 13px; font-weight: 500; padding: 10px 18px; border-radius: var(--r-sm); opacity: 0; pointer-events: none; transition: all .25s; z-index: 1100; }
.toast.show { opacity: 1; transform: translateX(-50%); }
