/* Resana: struttura e comportamento simili ad Asana, colori e font 2night. */

:root {
   /* 2night */
   --brand: #cd3174;
   --brand-hover: #b3285f;
   --brand-soft: #fbe9f1;
   --accent: #09c2bc;
   --accent-soft: #dcf6f5;
   --navy: #272a37;

   /* cornice scura (barra in alto e laterale) */
   --chrome: var(--navy);
   --chrome-2: #31354a;
   --chrome-hover: rgba(255, 255, 255, .08);
   --chrome-active: rgba(255, 255, 255, .15);
   --chrome-text: #eceef3;
   --chrome-muted: #a5a8b8;

   /* contenuto */
   --bg: #ffffff;
   --bg-soft: #f6f7f8;
   --bg-hover: #f2f3f5;
   --border: #e5e8e7;
   --border-strong: #cfd3d6;
   --text: #1e1f24;
   --text-2: #4b4c4b;
   --muted: #6b6a6a;
   --late: #d0453c;
   --soon: #2f9e5f;

   --radius: 8px;
   --radius-lg: 12px;
   --shadow-menu: 0 6px 24px rgba(20, 22, 33, .18), 0 1px 3px rgba(20, 22, 33, .12);
   --topbar-h: 52px;
   --sidebar-w: 240px;
   --ease: cubic-bezier(.2, .7, .3, 1);
   --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

   font-family: var(--font);
   font-size: 14px;
   line-height: 1.45;
   color: var(--text);
   -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--chrome); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- icone (sprite svg) ---------- */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic--sm { width: 16px; height: 16px; }
.ic--xs { width: 12px; height: 12px; stroke-width: 2.4; }

.icon-btn {
   display: inline-grid; place-items: center;
   width: 34px; height: 34px; border-radius: 6px;
   color: var(--chrome-muted);
   transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--chrome-hover); color: var(--chrome-text); }
.icon-btn--sm { width: 26px; height: 26px; }

/* ---------- avatar ---------- */
.avatar {
   --av: var(--brand);
   display: inline-grid; place-items: center; flex: none;
   width: 28px; height: 28px; border-radius: 50%;
   background: var(--av); color: #fff;
   font-size: 11px; font-weight: 700; letter-spacing: .02em;
   user-select: none;
   position: relative;
}
/* la foto copre le iniziali; se non c'è (404) resta trasparente e si vedono le iniziali */
.avatar::after {
   content: ""; position: absolute; inset: 0; border-radius: inherit;
   background: var(--ph, none) center / cover no-repeat;
   pointer-events: none;
}
.avatar--md { width: 30px; height: 30px; }
.avatar--lg { width: 40px; height: 40px; font-size: 14px; }
button.avatar { box-shadow: 0 0 0 2px transparent; transition: box-shadow .15s; }
button.avatar:hover, button.avatar[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--chrome), 0 0 0 4px var(--chrome-muted); }

/* ---------- marchio ---------- */
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--chrome-text); }
.brand__mark { position: relative; width: 22px; height: 20px; }
.brand__mark i { position: absolute; width: 10px; height: 10px; border-radius: 50%; }
.brand__mark i:nth-child(1) { left: 6px; top: 0; background: var(--brand); }
.brand__mark i:nth-child(2) { left: 0; top: 10px; background: var(--accent); }
.brand__mark i:nth-child(3) { left: 12px; top: 10px; background: #fff; }
.brand__name { font-weight: 900; font-size: 18px; letter-spacing: -.01em; }

/* ---------- barra in alto ---------- */
.topbar {
   position: fixed; inset: 0 0 auto 0; z-index: 30;
   height: var(--topbar-h);
   display: flex; align-items: center; gap: 10px;
   padding: 0 12px;
   background: var(--chrome);
   color: var(--chrome-text);
}
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar__search-mobile { display: none; }

.create { position: relative; }
.create__btn {
   display: inline-flex; align-items: center; gap: 6px;
   height: 32px; padding: 0 14px 0 10px; border-radius: 6px;
   background: var(--brand); color: #fff; font-weight: 700;
   transition: background .15s, transform .1s;
}
.create__btn:hover { background: var(--brand-hover); }
.create__btn:active { transform: scale(.97); }

.brand { margin: 0 6px 0 4px; }

.search {
   position: absolute; left: 50%; transform: translateX(-50%);
   width: min(560px, 40vw);
   display: flex; align-items: center;
}
.search__icon { position: absolute; left: 12px; color: var(--chrome-muted); pointer-events: none; }
.search__input {
   width: 100%; height: 34px; padding: 0 14px 0 36px;
   border-radius: 6px; border: 1px solid transparent;
   background: var(--chrome-2); color: var(--chrome-text);
   transition: background .15s, border-color .15s;
}
.search__input::placeholder { color: var(--chrome-muted); }
.search__input:hover { background: #3a3f57; }
.search__input:focus { outline: none; background: #fff; color: var(--text); border-color: var(--border-strong); }
.search__input:focus::placeholder { color: var(--muted); }
.search:focus-within .search__icon { color: var(--muted); }

/* ---------- menu a tendina ---------- */
.menu {
   position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
   min-width: 220px; padding: 6px 0;
   background: #fff; color: var(--text);
   border-radius: var(--radius); box-shadow: var(--shadow-menu);
   animation: menu-in .14s var(--ease);
}
.menu--right { left: auto; right: 0; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.menu__item {
   display: flex; align-items: center; gap: 10px; width: 100%;
   padding: 8px 16px; text-align: left; color: var(--text-2);
}
.menu__item:hover { background: var(--bg-hover); color: var(--text); }
.menu__item .ic { color: var(--muted); }
.menu__sep { height: 1px; margin: 6px 0; background: var(--border); }
.menu__head { display: flex; gap: 12px; align-items: center; padding: 10px 16px 8px; }
.menu__name { font-weight: 700; }
.menu__mail { color: var(--muted); font-size: 12px; }

/* ---------- struttura ---------- */
.shell { display: flex; padding-top: var(--topbar-h); height: 100%; }

.sidebar {
   flex: none; width: var(--sidebar-w);
   overflow-y: auto; overflow-x: hidden;
   padding: 8px 8px 24px;
   color: var(--chrome-text);
   transition: width .2s var(--ease), padding .2s var(--ease);
   scrollbar-width: thin; scrollbar-color: var(--chrome-2) transparent;
}
body.sidebar-collapsed .sidebar { width: 0; padding-left: 0; padding-right: 0; }

.nav { list-style: none; margin: 0; padding: 0; }
.nav__item {
   display: flex; align-items: center; gap: 10px;
   height: 34px; padding: 0 10px; border-radius: 6px;
   color: var(--chrome-text); white-space: nowrap;
   transition: background .12s;
}
.nav__item .ic { color: var(--chrome-muted); }
.nav__item:hover { background: var(--chrome-hover); }
.nav__item.is-active { background: var(--chrome-active); }
.nav__item.is-active .ic { color: #fff; }
.nav__label { overflow: hidden; text-overflow: ellipsis; }
.nav__badge {
   margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
   border-radius: 4px; background: var(--brand); color: #fff;
   font-size: 11px; line-height: 18px; text-align: center;
}

.nav-group { margin-top: 18px; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; }
.nav-group__head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 4px 4px; }
.nav-group__toggle {
   display: inline-flex; align-items: center; gap: 6px;
   padding: 4px 6px; border-radius: 4px;
   font-weight: 700; color: var(--chrome-text);
}
.nav-group__toggle:hover { background: var(--chrome-hover); }
.nav-group__toggle .ic { color: var(--chrome-muted); transition: transform .15s; }
.nav-group__toggle[aria-expanded="false"] .ic { transform: rotate(-90deg); }
.nav-group.is-collapsed > :not(.nav-group__head) { display: none; }
.nav-group__add { opacity: 0; }
.nav-group:hover .nav-group__add, .nav-group__add:focus-visible { opacity: 1; }
.nav-group__empty { margin: 4px 10px; color: var(--chrome-muted); font-size: 13px; }
.nav-group__empty a { color: var(--chrome-text); text-decoration: underline; text-underline-offset: 2px; }

.dot { --c: var(--brand); width: 12px; height: 12px; border-radius: 3px; background: var(--c); flex: none; }
.nav .dot { margin: 0 4px; }

.main {
   flex: 1; min-width: 0;
   background: var(--bg);
   border-top-left-radius: var(--radius-lg);
   overflow-y: auto;
}
body.sidebar-collapsed .main { border-top-left-radius: 0; }
.sidebar-backdrop { display: none; }

/* ---------- home ---------- */
.home { max-width: 1080px; margin: 0 auto; padding: 32px 32px 64px; }
.home__hello { text-align: center; margin-bottom: 28px; }
.home__date { margin: 0; color: var(--text-2); font-weight: 700; }
.home__title { margin: 4px 0 16px; font-size: 32px; font-weight: 400; letter-spacing: -.01em; }
.home__stats {
   display: inline-flex; align-items: center; gap: 14px;
   padding: 8px 18px; border-radius: 6px; background: var(--bg-soft);
   color: var(--text-2);
}
.home__stats b { color: var(--text); }
.home__stats .sep { width: 1px; height: 16px; background: var(--border-strong); }

.home__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.card {
   display: flex; flex-direction: column;
   min-height: 420px; max-height: 520px;
   border: 1px solid var(--border); border-radius: var(--radius);
   background: var(--bg);
   transition: box-shadow .2s, border-color .2s;
}
.card:hover { border-color: var(--border-strong); box-shadow: 0 2px 10px rgba(20, 22, 33, .06); }
.card__head { display: flex; gap: 14px; align-items: flex-start; padding: 20px 24px 0; }
.card__icon {
   display: grid; place-items: center; flex: none;
   width: 40px; height: 40px; border-radius: 50%;
   background: var(--accent-soft); color: #078d88;
}
.card__titles { flex: 1; min-width: 0; }
.card__title { margin: 6px 0 0; font-size: 20px; font-weight: 700; }
.card__title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.card__sub { margin: 4px 0 0; color: var(--muted); }
.card__body { flex: 1; overflow-y: auto; padding: 8px 24px 16px; }
.card__add {
   display: flex; align-items: center; gap: 8px;
   padding: 10px 4px; color: var(--muted);
   border-bottom: 1px solid var(--border);
}
.card__add:hover { color: var(--text); }

.tabs { display: flex; gap: 18px; margin-top: 10px; border-bottom: 1px solid var(--border); }
.tabs__tab {
   position: relative; padding: 6px 0 10px;
   color: var(--muted); font-weight: 700;
}
.tabs__tab:hover { color: var(--text); }
.tabs__tab.is-active { color: var(--text); }
.tabs__tab.is-active::after {
   content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
   height: 2px; border-radius: 2px; background: var(--brand);
}
.tabs__count {
   display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px;
   background: #fde8e6; color: var(--late); font-size: 11px;
}

/* ---------- righe di task ---------- */
.tasklist { list-style: none; margin: 0; padding: 0; }
.trow {
   display: flex; align-items: center; gap: 10px;
   min-height: 42px; padding: 6px 4px;
   border-bottom: 1px solid var(--border);
}
.trow:hover { background: var(--bg-hover); }
.trow__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow__meta { display: flex; align-items: center; gap: 8px; flex: none; }
.trow__due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.trow__due.is-late { color: var(--late); }
.trow__due.is-soon { color: var(--soon); }
.trow.is-done .trow__title { color: var(--muted); }

.check {
   display: inline-grid; place-items: center; flex: none;
   width: 18px; height: 18px; border-radius: 50%;
   border: 1.5px solid var(--border-strong); color: transparent;
   transition: all .15s;
}
.check .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.trow:hover .check, .check:hover { color: var(--muted); border-color: var(--muted); }
.trow.is-done .check { background: var(--accent); border-color: var(--accent); color: #fff; }

.chip {
   display: inline-flex; align-items: center; gap: 6px; max-width: 160px;
   height: 22px; padding: 0 8px; border-radius: 4px;
   background: var(--bg-soft); color: var(--text-2); font-size: 12px;
}
.chip .dot { width: 8px; height: 8px; border-radius: 2px; }
.chip__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- stati vuoti ---------- */
.empty { list-style: none; text-align: center; padding: 40px 16px; color: var(--muted); }
.empty__art { width: 56px; height: 56px; color: var(--border-strong); fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.empty__title { margin: 12px 0 4px; color: var(--text); font-weight: 700; font-size: 15px; }
.empty__text { margin: 0 auto; max-width: 340px; }
.empty--page { padding-top: 12vh; }
.empty--page .empty__art { width: 72px; height: 72px; }

/* ---------- pagina generica ---------- */
.page__head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.page__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.page__title { margin: 0; font-size: 20px; font-weight: 700; }
.page__body { padding: 24px; }

/* ---------- login ---------- */
body.login {
   min-height: 100%; display: grid; place-items: center; padding: 24px;
   background:
      radial-gradient(1200px 600px at 10% -10%, rgba(205, 49, 116, .35), transparent 60%),
      radial-gradient(900px 500px at 110% 110%, rgba(9, 194, 188, .28), transparent 60%),
      var(--navy);
}
.login__box {
   width: min(420px, 100%); padding: 40px 36px 32px;
   background: #fff; border-radius: 16px; text-align: center;
   box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.brand--big { color: var(--navy); }
.brand--big .brand__mark { transform: scale(1.4); margin-right: 8px; }
.brand--big .brand__mark i:nth-child(3) { background: var(--navy); }
.brand--big .brand__name { font-size: 28px; }
.login__title { margin: 24px 0 6px; font-size: 20px; }
.login__text { margin: 0 0 24px; color: var(--muted); }
.login__error { margin: 0 0 16px; padding: 10px; border-radius: 6px; background: #fde8e6; color: var(--late); }
.login__dev { margin-top: 28px; padding-top: 20px; border-top: 1px dashed var(--border-strong); display: grid; gap: 8px; }
.login__devtitle { margin: 0 0 4px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

.btn {
   display: inline-flex; align-items: center; justify-content: center; gap: 10px;
   height: 40px; padding: 0 18px; border-radius: 6px; font-weight: 700;
   transition: background .15s, border-color .15s;
}
.btn--ms { width: 100%; border: 1px solid var(--border-strong); background: #fff; }
.btn--ms:hover { background: var(--bg-soft); }
.ms-logo { width: 20px; height: 20px; }
.btn--ghost { width: 100%; border: 1px solid var(--border); color: var(--text-2); font-weight: 400; }
.btn--ghost:hover { background: var(--bg-soft); }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
   .home__grid { grid-template-columns: minmax(0, 1fr); }
   .card { min-height: 0; }
}

/* ---------- mobile ---------- */
@media (max-width: 768px) {
   :root { --topbar-h: 52px; }
   .brand__name { display: none; }
   .create__btn { width: 34px; padding: 0; justify-content: center; }
   .create__btn span { display: none; }

   .search { display: none; }
   body.search-open .search {
      display: flex; position: fixed; left: 8px; right: 8px; top: 9px;
      width: auto; transform: none; z-index: 40;
   }
   body.search-open .search__input { background: #fff; color: var(--text); }
   .topbar__search-mobile { display: inline-grid; }

   .sidebar {
      position: fixed; z-index: 45; top: 0; bottom: 0; left: 0;
      width: min(300px, 84vw); padding-top: 16px;
      background: var(--chrome);
      transform: translateX(-100%);
      transition: transform .22s var(--ease), box-shadow .22s;
   }
   body.sidebar-open .sidebar { box-shadow: 8px 0 32px rgba(0, 0, 0, .3); }
   body.sidebar-collapsed .sidebar { width: min(300px, 84vw); padding: 16px 8px 24px; }
   body.sidebar-open .sidebar { transform: none; }
   .sidebar-backdrop {
      display: block; position: fixed; inset: 0; z-index: 44;
      background: rgba(10, 12, 20, .45);
      opacity: 0; pointer-events: none; transition: opacity .2s;
   }
   body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
   .nav-group__add { opacity: 1; }
   .nav__item { height: 42px; }

   .main { border-radius: 0; }
   .home { padding: 20px 14px 48px; }
   .home__title { font-size: 24px; }
   .home__stats { gap: 10px; padding: 6px 14px; font-size: 13px; }
   .card { max-height: none; }
   .card__head { padding: 16px 16px 0; }
   .card__body { padding: 4px 16px 12px; }
   .trow { min-height: 48px; }
   .trow__project { display: none; }
   .page__head { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
   * { animation: none !important; transition: none !important; }
}

/* =================================================================== M2 */

/* ---------- bottoni ---------- */
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); }
.btn--outline { border: 1px solid var(--border-strong); color: var(--text-2); background: #fff; }
.btn--outline:hover { background: var(--bg-soft); color: var(--text); }
.btn--sm { height: 32px; padding: 0 12px; gap: 6px; font-size: 13px; }
.btn--ghost-inline { color: var(--text-2); }
.btn--ghost-inline:hover { background: var(--bg-soft); }
.icon-btn--light { color: var(--muted); }
.icon-btn--light:hover { background: var(--bg-hover); color: var(--text); }
.menu__item--danger, .menu__item--danger .ic { color: var(--late); }
.muted { color: var(--muted); }

/* ---------- form a pagina ---------- */
.formpage { position: relative; min-height: 100%; padding: 56px 20px; background: var(--bg-soft); }
.formpage__close { position: absolute; top: 14px; right: 14px; }
.formcard {
   max-width: 560px; margin: 0 auto; padding: 32px;
   background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
   box-shadow: 0 4px 24px rgba(20, 22, 33, .06);
}
.formcard__title { margin: 0; font-size: 24px; }
.formcard__sub { margin: 6px 0 20px; color: var(--muted); }
.formcard__sub:empty { display: none; }
.formcard__h2 { margin: 24px 0 8px; font-size: 14px; color: var(--text-2); }
.formcard__error { padding: 10px 12px; border-radius: 6px; background: #fde8e6; color: var(--late); }
.formcard__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 28px; }

.field { display: block; margin: 0 0 18px; padding: 0; border: 0; }
.field__label { display: block; margin-bottom: 6px; font-weight: 700; color: var(--text-2); font-size: 13px; padding: 0; }
.field__hint { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.input {
   width: 100%; height: 38px; padding: 0 12px;
   border: 1px solid var(--border-strong); border-radius: 6px; background: #fff;
   transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: #b4b9bd; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input--lg { height: 44px; font-size: 16px; }
select.input { appearance: none; padding-right: 32px;
   background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6a6a' stroke-width='2'%3E%3Cpath d='m7 9.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch__dot {
   --c: var(--brand); display: block; width: 30px; height: 30px; border-radius: 6px;
   background: var(--c); cursor: pointer; box-shadow: 0 0 0 2px #fff, 0 0 0 2px transparent;
   transition: box-shadow .12s, transform .12s;
}
.swatch__dot:hover { transform: scale(1.08); }
.swatch input:checked + .swatch__dot { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.swatch input:focus-visible + .swatch__dot { outline: 2px solid var(--accent); outline-offset: 4px; }

.viewpick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.viewpick__opt input { position: absolute; opacity: 0; }
.viewpick__opt span {
   display: flex; align-items: center; gap: 8px; padding: 12px 14px;
   border: 1px solid var(--border-strong); border-radius: 6px; cursor: pointer; color: var(--text-2);
}
.viewpick__opt input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--text); }
.viewpick__opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- persone ---------- */
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--more { --av: #e5e8e7; color: var(--text-2); }
.avatars { display: inline-flex; padding-left: 6px; }
.avatars .avatar { margin-left: -6px; box-shadow: 0 0 0 2px #fff; }
.avatars:hover .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--border-strong); }
.people { list-style: none; margin: 0; padding: 0; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.person__name { font-weight: 700; }
.person__mail { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.person__remove { margin-left: auto; }
.addperson { display: flex; gap: 8px; margin-top: 12px; }
.addperson .input { flex: 1; min-width: 0; }

/* ---------- intestazione progetto ---------- */
.phead { padding: 16px 24px 0; border-bottom: 1px solid var(--border); }
.phead__row { display: flex; align-items: center; gap: 12px; }
.phead__icon {
   --c: var(--brand); display: grid; place-items: center; flex: none;
   width: 36px; height: 36px; border-radius: 8px; background: var(--c); color: #fff;
}
.phead__titles { min-width: 0; }
.phead__team { display: block; font-size: 12px; color: var(--muted); }
.phead__team:hover { color: var(--text); text-decoration: underline; }
.phead__title { margin: 0; font-size: 20px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phead__right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex: none; }
.phead__tabs { border-bottom: 0; margin-top: 12px; }
.tabs__tab { display: inline-flex; align-items: center; gap: 6px; }
.tabs__tab.is-disabled { opacity: .45; cursor: default; }
.tabs__tab.is-disabled:hover { color: var(--muted); }

.ptoolbar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; }
.ptoolbar__link { color: var(--muted); font-size: 13px; }
.ptoolbar__link:hover { color: var(--text); text-decoration: underline; }

/* ---------- lista ---------- */
.ltable { --cols: minmax(0, 1fr) 170px 110px; padding: 0 24px 80px; }
.ltable__head {
   display: grid; grid-template-columns: var(--cols);
   border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
   color: var(--muted); font-size: 12px;
}
.ltable__head > span { padding: 8px 10px; border-left: 1px solid var(--border); }
.ltable__head > span:first-child { border-left: 0; padding-left: 34px; }

.lsection { margin-top: 18px; }
.lsection__head { display: flex; align-items: center; gap: 4px; height: 40px; }
.lsection__caret .ic { transition: transform .15s; }
.lsection.is-collapsed .lsection__caret .ic { transform: rotate(-90deg); }
.lsection.is-collapsed .lrows, .lsection.is-collapsed .ladd { display: none; }
.lsection__rename { min-width: 0; }
.lsection__name {
   width: auto; max-width: 100%; height: 30px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px;
   background: none; font-size: 16px; font-weight: 700; field-sizing: content; min-width: 4ch;
}
.lsection__name:hover { border-color: var(--border); }
.lsection__name:focus { outline: none; border-color: var(--brand); background: #fff; }
.lsection__count { color: var(--muted); font-size: 13px; }
.lsection__menu { position: relative; opacity: 0; transition: opacity .12s; }
.lsection__head:hover .lsection__menu, .lsection__menu:focus-within { opacity: 1; }

.lrows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.lrow {
   display: grid; grid-template-columns: 34px minmax(0, 1fr) 170px 110px; align-items: center;
   min-height: 38px; border-bottom: 1px solid var(--border); column-gap: 0;
}
.lrow:hover { background: var(--bg-hover); }
.lrow__check { display: grid; place-items: center; }
.lrow__name { display: flex; align-items: center; min-width: 0; height: 100%; }
.lrow__title { min-width: 0; padding: 8px 10px 8px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow__title:hover { text-decoration: underline; text-underline-offset: 2px; }
.lrow__sub { display: inline-flex; align-items: center; gap: 2px; padding-right: 10px; color: var(--muted); font-size: 12px; }
.lrow__who, .lrow__due { height: 100%; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-left: 1px solid var(--border); font-size: 13px; }
.lrow__whoname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.lrow__due { color: var(--muted); }
.lrow__due.is-late { color: var(--late); }
.lrow__due.is-soon { color: var(--soon); }
.lrow.is-done .lrow__title { color: var(--muted); }
.lrow.is-done .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.lrow.is-new { animation: row-in .5s var(--ease); }
@keyframes row-in { from { background: var(--brand-soft); } }
.lrow .check:hover { color: var(--accent); border-color: var(--accent); }
.lrow.is-done .check:hover { background: #07a9a4; }

.ladd { display: flex; align-items: center; gap: 6px; height: 38px; padding-left: 8px; border-bottom: 1px solid transparent; }
.ladd:focus-within { border-bottom-color: var(--border); }
.check--ghost { border-style: dashed; }
.ladd__input { flex: 1; height: 100%; border: 0; background: none; padding: 0 4px; }
.ladd__input::placeholder { color: var(--muted); }
.ladd__input:focus { outline: none; }
.ladd__input:focus::placeholder { color: #aaa; }
.ladd.is-error .ladd__input { color: var(--late); }

.add-section { display: flex; align-items: center; gap: 8px; margin-top: 24px; padding: 0 6px; color: var(--muted); }
.add-section__input { flex: 1; max-width: 360px; height: 34px; border: 1px solid transparent; border-radius: 6px; background: none; padding: 0 8px; font-weight: 700; font-size: 15px; }
.add-section__input::placeholder { color: var(--muted); }
.add-section__input:hover { border-color: var(--border); }
.add-section__input:focus { outline: none; border-color: var(--brand); background: #fff; color: var(--text); }

/* ---------- team ---------- */
.thead { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.thead__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--accent-soft); color: #078d88; }
.thead__title { margin: 0; font-size: 22px; }
.thead__right { margin-left: auto; }
.team__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 32px; padding: 24px; max-width: 1200px; }
.team__blockhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.team__blockhead h2 { margin: 0; font-size: 16px; }
.ptiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ptile {
   display: flex; align-items: center; gap: 12px; padding: 14px;
   border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s;
}
.ptile:hover { border-color: var(--border-strong); box-shadow: 0 2px 10px rgba(20, 22, 33, .06); }
.ptile__icon { --c: var(--brand); display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--c); color: #fff; }
.ptile__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

@media (max-width: 1100px) {
   .ltable { --cols: minmax(0, 1fr) 120px 96px; }
   .lrow { grid-template-columns: 34px minmax(0, 1fr) 120px 96px; }
   .team__grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
   .phead { padding: 12px 14px 0; }
   .phead__title { font-size: 18px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
   .phead__right .btn span, .phead__right .btn { font-size: 0; gap: 0; padding: 0 8px; }
   .phead__right .btn .ic { margin: 0; }
   .ptoolbar { padding: 10px 14px; }
   .ltable { padding: 0 8px 80px; }
   .ltable__head { display: none; }
   .lrow { grid-template-columns: 34px minmax(0, 1fr) auto auto; min-height: 48px; }
   .lrow__who { border: 0; padding: 0 4px; }
   .lrow__whoname { display: none; }
   .lrow__due { border: 0; padding: 0 8px 0 4px; font-size: 12px; }
   .lrow__due:empty { display: none; }
   .ladd { height: 48px; }
   .lsection__menu { opacity: 1; }
   .formpage { padding: 48px 0 0; background: #fff; }
   .formcard { border: 0; box-shadow: none; padding: 8px 18px 32px; }
   .thead { padding: 14px; flex-wrap: wrap; }
   .team__grid { padding: 14px; }
}
.lsection__title { margin: 0 6px; font-size: 16px; }
.lrow__who .chip { max-width: 100%; }
.lsection--late .lsection__title { color: var(--late); }

/* ---------- spostare i task ---------- */
.lrow__more { flex: none; margin-left: auto; margin-right: 6px; opacity: 0; }
.lrow:hover .lrow__more, .lrow__more:focus-visible, .lrow__more[aria-expanded="true"] { opacity: 1; }
.lrow[draggable="true"] { cursor: grab; }
.lrow[draggable="true"] a, .lrow[draggable="true"] button { cursor: pointer; }
.lrow.is-dragging { opacity: .4; }
.lrow.drop-before { box-shadow: inset 0 2px 0 var(--brand); }
.lsection.drop-end .lrows { box-shadow: inset 0 -2px 0 var(--brand); }
.lsection.drop-end .lrows:empty { min-height: 38px; background: var(--brand-soft); }
.rowmenu { position: fixed; top: 0; left: 0; min-width: 240px; max-height: 60vh; overflow-y: auto; }
.menu__label { padding: 6px 16px 4px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.menu__item.is-current { color: var(--muted); cursor: default; }
.menu__item.is-current::after { content: "attuale"; margin-left: auto; font-size: 12px; }
@media (max-width: 768px) { .lrow__more { opacity: 1; } }

/* =================================================================== M3: pannello del task */

.panehost {
   position: fixed; z-index: 35; top: var(--topbar-h); right: 0; bottom: 0;
   width: min(720px, calc(100vw - var(--sidebar-w) - 40px));
   background: #fff; border-left: 1px solid var(--border);
   box-shadow: -12px 0 32px rgba(20, 22, 33, .10);
   transform: translateX(100%); transition: transform .22s var(--ease);
   display: flex; flex-direction: column;
}
body.pane-open .panehost { transform: none; }
.panehost:empty { display: none; }
.lrow.is-open { background: var(--brand-soft); }
.lrow.is-open:hover { background: #f8dcea; }

.taskpage { max-width: 860px; margin: 0 auto; min-height: 100%; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.taskpage { height: 100%; }
.taskpage .tpane { height: calc(100dvh - var(--topbar-h)); }

.tpane { display: flex; flex-direction: column; height: 100%; min-height: 0; background: #fff; }
.tpane__bar {
   display: flex; align-items: center; gap: 8px; flex: none;
   padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.tpane__tools { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.tpane__more { position: relative; }
.tpane__scroll { flex: 1; overflow-y: auto; padding: 16px 28px 32px; }

.donebtn {
   display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
   border: 1px solid var(--border-strong); border-radius: 6px; color: var(--text-2); font-size: 13px;
   transition: all .15s;
}
.donebtn:hover { border-color: var(--accent); color: #078d88; background: var(--accent-soft); }
.donebtn__done { display: none; }
.tpane.is-done .donebtn { background: var(--accent); border-color: var(--accent); color: #fff; }
.tpane.is-done .donebtn__todo { display: none; }
.tpane.is-done .donebtn__done { display: inline; }

.tpane__banner { display: none; align-items: center; gap: 8px; margin: -16px -28px 16px; padding: 10px 28px; background: var(--accent-soft); color: #067a76; font-size: 13px; }
.tpane.is-done .tpane__banner { display: flex; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-bottom: 6px; font-size: 13px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 2px 6px; border-radius: 4px; color: var(--muted); }
.crumb + .crumb::before { content: "›"; margin: 0 4px 0 -4px; color: var(--border-strong); }
.crumb .dot { width: 10px; height: 10px; }
.crumb__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.crumb:hover { background: var(--bg-hover); color: var(--text); }
.crumb--hidden { font-style: italic; cursor: default; }
.crumb--hidden .dot { --c: var(--border-strong) !important; }

.tpane__title {
   display: block; width: 100%; margin: 0 0 12px -8px; padding: 4px 8px;
   border: 1px solid transparent; border-radius: 6px; resize: none; overflow: hidden;
   font: 700 24px/1.3 var(--font); color: var(--text); background: none;
}
.tpane__title:hover { border-color: var(--border); }
.tpane__title:focus { outline: none; border-color: var(--brand); }
.tpane.is-done .tpane__title { color: var(--text-2); }

.fields { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; row-gap: 4px; margin-bottom: 20px; }
.fields__label { color: var(--muted); font-size: 13px; }
.fields__value { display: flex; align-items: center; gap: 6px; min-height: 36px; min-width: 0; }
.fields__value--wrap { flex-wrap: wrap; }
.fields__value--wrap form { display: flex; align-items: center; gap: 6px; }
.fields__value--text { color: var(--text-2); font-size: 13px; }
.fields__icon { color: var(--muted); }
.fselect {
   max-width: 100%; height: 32px; padding: 0 28px 0 8px; border: 1px solid transparent; border-radius: 6px;
   background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6a6a' stroke-width='2'%3E%3Cpath d='m7 9.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 6px center / 14px;
   appearance: none; color: var(--text); cursor: pointer; text-overflow: ellipsis;
}
.fselect:hover { border-color: var(--border); background-color: var(--bg-soft); }
.fselect:focus { outline: none; border-color: var(--brand); }
.fselect:disabled { cursor: default; color: var(--muted); background-image: none; }
.fselect--muted { color: var(--text-2); }
.fdate { height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--text); }
.fdate:hover { border-color: var(--border); background: var(--bg-soft); }
.fdate:focus { outline: none; border-color: var(--brand); }

.tsec { margin-top: 24px; }
.tsec__title { margin: 0 0 8px; font-size: 15px; }
.tsec__count { color: var(--muted); font-weight: 400; }
.tsec--comments { padding-top: 16px; border-top: 1px solid var(--border); }

/* editor */
.rte { border: 1px solid transparent; border-radius: 8px; transition: border-color .15s, box-shadow .15s; }
.rte.is-editing { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.rte__bar {
   display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 4px 6px;
   border-bottom: 1px solid var(--border);
}
.rte:not(.is-editing) .rte__bar, .rte:not(.is-editing) .rte__actions { display: none; }
.rte__btn { min-width: 30px; height: 28px; padding: 0 6px; border-radius: 4px; color: var(--text-2); font-size: 13px; display: inline-grid; place-items: center; }
.rte__btn:hover { background: var(--bg-hover); color: var(--text); }
.rte__sep { width: 1px; height: 18px; margin: 0 4px; background: var(--border); }
.rte__status { color: var(--muted); font-size: 12px; }
.rte__actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 6px 8px; border-top: 1px solid var(--border); }
.rte__hint { margin-right: auto; color: var(--muted); font-size: 12px; }
.rte:not(.is-editing) .rte__body { padding-left: 0; padding-right: 0; min-height: 0; }
.rte.is-blank .rte__body { display: none; }
.rte__empty { display: none; width: 100%; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 8px; color: var(--muted); text-align: left; }
.rte__empty:hover { border-color: var(--brand); color: var(--text); }
.rte.is-blank:not(.is-editing) .rte__empty { display: block; }
.rte__draft { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding: 8px 10px; border-radius: 6px; background: #fff6e0; color: #7a5a00; font-size: 13px; }
.rte__draft span { margin-right: auto; }
.tsec__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tsec__head .tsec__title { margin: 0; }
.rte__body { min-height: 90px; padding: 10px 12px; outline: none; line-height: 1.6; overflow-wrap: anywhere; }
.rte__body.is-empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; position: absolute; }
.rte__body > :first-child { margin-top: 0; }
.rte__body > :last-child { margin-bottom: 0; }
.rte__body h2 { font-size: 18px; margin: 18px 0 6px; }
.rte__body h3 { font-size: 15px; margin: 14px 0 4px; }
.rte__body p { margin: 0 0 8px; }
.rte__body ul, .rte__body ol { margin: 0 0 8px; padding-left: 24px; }
.rte__body li { margin: 2px 0; }
.rte__body s { color: var(--muted); }
.rte__body a { color: #1f6fb2; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.rte__body blockquote { margin: 0 0 8px; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.rte__body pre, .rte__body code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--bg-soft); border-radius: 4px; }
.rte__body pre { padding: 8px 10px; overflow-x: auto; }
.rte__body table { border-collapse: collapse; margin: 0 0 8px; }
.rte__body td, .rte__body th { border: 1px solid var(--border-strong); padding: 4px 8px; vertical-align: top; }
.rte__body img { max-width: 100%; border-radius: 6px; }

/* sottotask: righe compatte */
.subs { border-top: 1px solid var(--border); }
.subs .lrow { grid-template-columns: 34px minmax(0, 1fr) auto auto; min-height: 36px; }
.subs .lrow__who, .subs .lrow__due { border-left: 0; padding: 0 6px; }
.subs .lrow__whoname { display: none; }
.subs .lrow__due:empty { display: none; }
.ladd--sub { padding-left: 8px; }

/* piede: collaboratori */
.tpane__foot {
   display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: none;
   padding: 10px 16px; border-top: 1px solid var(--border); background: var(--bg-soft);
}
.tpane__footlabel { color: var(--muted); font-size: 13px; }
.collabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.collab { position: relative; }
.collab__remove { position: absolute; top: -6px; right: -6px; display: none; }
.collab:hover .collab__remove { display: block; }
.collab__remove button {
   width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); color: #fff;
   font-size: 12px; line-height: 16px; text-align: center;
}
.fselect--add { height: 28px; border: 1px dashed var(--border-strong); color: var(--muted); font-size: 13px; background-image: none; padding: 0 10px; }
.fselect--add:hover { color: var(--text); }
.tpane__leave { margin-left: auto; }

/* messaggi brevi */
.toast {
   position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translateX(-50%);
   padding: 10px 16px; border-radius: 6px; background: var(--navy); color: #fff;
   box-shadow: var(--shadow-menu); animation: menu-in .15s var(--ease); transition: opacity .3s;
}
.toast.is-out { opacity: 0; }

@media (max-width: 768px) {
   .panehost { top: 0; width: 100vw; z-index: 60; border-left: 0; }
   .taskpage { border: 0; }
   .tpane__scroll { padding: 12px 16px 32px; }
   .tpane__banner { margin: -12px -16px 12px; padding: 10px 16px; }
   .tpane__title { font-size: 20px; }
   .fields { grid-template-columns: 104px minmax(0, 1fr); }
   .rte__hint { display: none; }
   .tpane__foot { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
}
.fields__value--wrap form { min-width: 0; max-width: 100%; }
.fields__value--wrap .fselect { min-width: 0; width: 100%; }
.fields__value--wrap form:first-child { flex: 0 1 auto; }
.tpane__scroll { overflow-x: hidden; }
.taskpage .js-open-full { display: none; }

/* =================================================================== M4: flusso, commenti, menzioni */

.avatar--xs { width: 20px; height: 20px; font-size: 9px; }

.feed { padding-top: 16px; border-top: 1px solid var(--border); }
.feed__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.feed__jump { font-size: 13px; color: var(--brand); white-space: nowrap; }
.feed__jump:hover { text-decoration: underline; }
.feed__list { list-style: none; margin: 8px 0 0; padding: 0; }

/* modifiche: righe compatte */
.ev { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0 5px 6px; color: var(--muted); font-size: 13px; line-height: 20px; }
.ev__text { flex: 1; min-width: 0; }
.ev__who { color: var(--text-2); font-weight: 700; }
.ev__what a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.ev__what b { color: var(--text-2); }
.ev__time { flex: none; font-size: 12px; }
.ev .avatar { margin-top: 0; opacity: .9; }

/* commenti: blocchi pieni */
.cm { display: flex; gap: 10px; padding: 12px 8px; margin: 6px -8px; border-radius: 8px; transition: background .4s; }
.cm:hover { background: var(--bg-soft); }
.cm.is-flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 30% { background: var(--brand-soft); } 100% { background: transparent; } }
.cm > .avatar { margin-top: 2px; }
.cm__main { flex: 1; min-width: 0; }
.cm__head { display: flex; align-items: baseline; gap: 8px; min-height: 24px; }
.cm__who { font-weight: 700; }
.cm__time, .cm__edited { color: var(--muted); font-size: 12px; }
.cm__tools { margin-left: auto; display: flex; align-items: center; gap: 2px; opacity: 0; transition: opacity .12s; }
.cm:hover .cm__tools, .cm__tools:focus-within { opacity: 1; }
.cm__tool { display: inline-grid; place-items: center; min-width: 28px; height: 26px; border-radius: 6px; color: var(--muted); font-size: 14px; }
.cm__tool:hover { background: var(--bg-hover); color: var(--text); }
.cm__more { position: relative; }
.cm__body { padding: 2px 0 0; min-height: 0; }
.cm__body[contenteditable="true"] { padding: 8px 10px; border: 1px solid var(--brand); border-radius: 6px; background: #fff; outline: none; }
.cm__editbar { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.cm--deleted .cm__body { color: var(--muted); font-style: italic; }
.cm__reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cm__reactions:empty { display: none; }
.react {
   display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px;
   border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 13px;
}
.react:hover { border-color: var(--border-strong); }
.react.is-mine { border-color: var(--brand); background: var(--brand-soft); }
.react__n { color: var(--text-2); font-size: 12px; }
.emojipicker {
   position: fixed; z-index: 70; display: flex; gap: 2px; padding: 4px;
   background: #fff; border-radius: 8px; box-shadow: var(--shadow-menu); animation: menu-in .12s var(--ease);
}
.emojipicker button { width: 34px; height: 34px; border-radius: 6px; font-size: 18px; }
.emojipicker button:hover { background: var(--bg-hover); transform: scale(1.15); }

/* menzioni */
.mention { display: inline; padding: 0 3px; border-radius: 4px; background: #e9eefb; color: #2b4a9a !important; font-weight: 700; text-decoration: none !important; white-space: nowrap; }
.mention--task { background: var(--accent-soft); color: #067a76 !important; font-weight: 400; }
a.mention--task:hover { text-decoration: underline !important; }
.mention--hidden { background: var(--bg-soft); color: var(--muted) !important; font-style: italic; font-weight: 400; }

.mentionbox {
   position: fixed; z-index: 80; width: 300px; max-height: 260px; overflow-y: auto; padding: 4px 0;
   background: #fff; border-radius: 8px; box-shadow: var(--shadow-menu);
}
.mentionbox__head { padding: 6px 12px 2px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.mentionbox__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 12px; text-align: left; }
.mentionbox__item.is-active, .mentionbox__item:hover { background: var(--brand-soft); }
.mentionbox__label { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.mentionbox__sub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.mentionbox__task { color: var(--accent); display: inline-grid; place-items: center; width: 20px; }
.mentionbox__empty { padding: 10px 12px; color: var(--muted); font-size: 13px; }

/* campo commento, fisso in fondo al pannello */
.composer { display: flex; gap: 10px; align-items: flex-start; flex: none; padding: 10px 16px; border-top: 1px solid var(--border); background: #fff; }
.composer > .avatar { margin-top: 6px; }
.composer__box { flex: 1; min-width: 0; border: 1px solid var(--border-strong); border-radius: 8px; transition: border-color .15s, box-shadow .15s; }
.composer.is-focused .composer__box { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.composer__input { min-height: 38px; max-height: 40vh; overflow-y: auto; padding: 8px 12px; outline: none; }
.composer__input.is-empty::before { content: attr(data-placeholder); color: var(--muted); position: absolute; pointer-events: none; }
.composer__bar { display: none; align-items: center; justify-content: flex-end; gap: 10px; padding: 4px 6px 6px; }
.composer.is-focused .composer__bar, .composer.has-text .composer__bar { display: flex; }
.composer__hint { color: var(--muted); font-size: 12px; }
.composer.is-sending .composer__send { opacity: .6; pointer-events: none; }

@media (max-width: 768px) {
   .cm__tools { opacity: 1; }
   .composer { padding: 8px 10px; }
   .composer > .avatar { display: none; }
   .composer__hint { display: none; }
   .composer__bar { display: flex; }
   .ev__time { display: none; }
}
.trow__who { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 768px) { .trow__who { max-width: 110px; overflow: hidden; text-overflow: ellipsis; } }

/* =================================================================== M4b: assegnatari e code dei team */
.achip {
   display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px;
   border-radius: 6px; background: var(--bg-soft); font-size: 13px;
}
.achip__name { white-space: nowrap; }
.achip__x button { width: 20px; height: 20px; border-radius: 4px; color: var(--muted); font-size: 15px; line-height: 20px; }
.achip__x button:hover { background: var(--border); color: var(--text); }
.achip--team { padding-left: 8px; background: var(--accent-soft); color: #067a76; }
.achip__note { color: #3a9b97; font-size: 12px; }
.fields__note { color: var(--muted); font-size: 12px; }
.lrow__who--many { gap: 0; }
.lrow__who--many .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px #fff; }
.teamtag { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 0 6px; height: 22px; border-radius: 4px; background: var(--accent-soft); color: #067a76; font-size: 12px; }
.teamtag__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; line-height: 18px; }
.person__actions { position: relative; margin-left: auto; }
.qlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.qrow { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid var(--border); }
.qrow__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow__title:hover { text-decoration: underline; }
.qrow__meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.team__hint { margin: 0 0 10px; font-size: 13px; }
.team__error { margin: 12px 24px 0; padding: 10px 12px; border-radius: 6px; background: #fde8e6; color: var(--late); }
.team__col { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.lrow__who--many .teamtag, .lrow__who .avatar + .teamtag { margin-left: 6px; }

/* task che ho solo tramite un mio team */
.teamtag--row { flex: none; margin: 0 8px 0 0; height: 20px; font-size: 11px; max-width: 160px; }
.trow .teamtag--row { margin: 0 0 0 6px; }
.trow__title { flex: 0 1 auto; }
.trow .trow__meta { margin-left: auto; }

/* filtro a segmenti */
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; }
.seg__opt { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 4px; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.seg__opt:hover { background: var(--bg-hover); color: var(--text); }
.seg__opt.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.seg__n { color: var(--muted); font-weight: 400; font-size: 12px; }
.seg__n:empty { display: none; }
@media (max-width: 768px) {
   .ptoolbar { flex-wrap: wrap; row-gap: 8px; }
   .seg { order: 3; width: 100%; }
   .seg__opt { flex: 1; justify-content: center; padding: 0 6px; }
   .teamtag--row { max-width: 96px; }
}
@media (max-width: 768px) {
   .ltable[data-rowmode=mine] .lrow { grid-template-columns: 34px minmax(0, 1fr) auto; }
   .ltable[data-rowmode=mine] .lrow__who { display: none; }
   .teamtag--row .teamtag__name { display: none; }
   .teamtag--row { padding: 0 5px; }
}

/* task che ho solo tramite un mio team: solo l'icona, il nome del team nel tooltip */
.teamtag--row { height: auto; max-width: none; margin-right: 8px; padding: 0; background: none; color: var(--muted); cursor: help; }
.teamtag--row .teamtag__name { display: none; }
.teamtag--row:hover { color: #067a76; }
.trow .teamtag--row { margin: 0 0 0 6px; }

/* =================================================================== M5: allegati */
.attach-btn { cursor: pointer; }
.atts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.atts:empty { display: none; }
.atts__hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.atts:not(:empty) + .atts__hint { display: none; }
.att { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: #fff; min-width: 0; }
.att:hover { border-color: var(--border-strong); }
.att__thumb {
   flex: none; display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden;
   border-radius: 6px; background: var(--bg-soft); color: var(--text-2);
}
.att__thumb img { width: 100%; height: 100%; object-fit: cover; }
.att__ext { font-size: 11px; font-weight: 900; letter-spacing: .02em; }
.att__info { display: flex; flex-direction: column; min-width: 0; }
.att__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 13px; }
.att__name:hover { text-decoration: underline; }
.att__meta { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att__del { position: absolute; top: 4px; right: 4px; opacity: 0; }
.att:hover .att__del, .att__del:focus-within { opacity: 1; }
.att__del button { width: 20px; height: 20px; border-radius: 4px; background: rgba(255, 255, 255, .9); color: var(--muted); font-size: 15px; line-height: 20px; }
.att__del button:hover { background: var(--border); color: var(--text); }
.att--loading { opacity: .7; }

.tpane.is-dropping .tpane__scroll { outline: 2px dashed var(--brand); outline-offset: -8px; background: var(--brand-soft); }

/* immagini e file nei testi */
.cm__body img, .rte__body img { display: block; max-width: min(100%, 520px); max-height: 420px; margin: 6px 0; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; }
[contenteditable=true] img { cursor: default; }
img.is-uploading { opacity: .5; animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .25; } }
.filelink { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 4px; background: var(--bg-soft); color: var(--text) !important; text-decoration: none !important; }
.filelink::before { content: "📎"; font-size: 12px; }
.filelink:hover { background: var(--border); }
.filelink.is-uploading { opacity: .6; }

@media (max-width: 768px) {
   .atts { grid-template-columns: 1fr; }
   .att__del { opacity: 1; }
}

/* =================================================================== modale delle immagini */
body.lightbox-open { overflow: hidden; }
.lightbox {
   position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: auto 1fr; grid-template-columns: 64px 1fr 64px;
   background: rgba(16, 18, 26, .92); color: #fff; animation: lb-in .15s var(--ease);
}
@keyframes lb-in { from { opacity: 0; } }
.lightbox__bar {
   grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 20px;
   background: linear-gradient(rgba(0, 0, 0, .4), transparent);
}
.lightbox__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.lightbox__count { color: rgba(255, 255, 255, .7); font-size: 13px; white-space: nowrap; margin-right: 8px; }
.lightbox__btn {
   display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 6px;
   background: rgba(255, 255, 255, .12); color: #fff; font-size: 13px; white-space: nowrap;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .22); }
.lightbox__close { display: grid; place-items: center; width: 38px; height: 38px; margin-left: 4px; border-radius: 6px; color: #fff; }
.lightbox__close:hover { background: rgba(255, 255, 255, .15); }
.lightbox__stage { grid-column: 2; grid-row: 2; margin: 0; display: grid; place-items: center; min-height: 0; padding: 8px 0 28px; }
.lightbox__img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); background: #fff; }
.lightbox__nav {
   grid-row: 2; align-self: center; justify-self: center; width: 44px; height: 64px; border-radius: 8px;
   color: #fff; font-size: 36px; line-height: 1; background: rgba(255, 255, 255, .08);
}
.lightbox__nav:hover { background: rgba(255, 255, 255, .2); }
.lightbox__nav--prev { grid-column: 1; }
.lightbox__nav--next { grid-column: 3; }
.lightbox.is-single .lightbox__nav { display: none; }

/* scaricare dal riquadro */
.att__dl {
   position: absolute; top: 4px; right: 28px; display: grid; place-items: center; width: 20px; height: 20px;
   border-radius: 4px; background: rgba(255, 255, 255, .9); color: var(--muted); opacity: 0;
}
.att:hover .att__dl, .att__dl:focus-visible { opacity: 1; }
.att__dl:hover { background: var(--border); color: var(--text); }
.att--image .att__thumb { cursor: zoom-in; }

@media (max-width: 768px) {
   .lightbox { grid-template-columns: 0 1fr 0; }
   .lightbox__bar { padding: 8px 6px 8px 12px; }
   .lightbox__btn span { display: none; }
   .lightbox__btn { padding: 0 9px; }
   .lightbox__count { display: none; }
   .lightbox__nav { position: fixed; bottom: 16px; width: 56px; height: 48px; font-size: 30px; }
   .lightbox__nav--prev { left: 16px; }
   .lightbox__nav--next { right: 16px; }
   .lightbox__img { max-height: calc(100vh - 150px); }
   .att__dl { opacity: 1; }
}

/* bottone "Scarica" sopra le immagini nei testi */
.imgtools {
   position: fixed; z-index: 90; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px;
   border-radius: 6px; background: rgba(39, 42, 55, .85); color: #fff; font-size: 12px; font-weight: 700;
   box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.imgtools:hover { background: var(--navy); }
@media (hover: none) { .imgtools { display: none; } }

/* allegati: quelli incollati nei testi a parte, con il posto in cui stanno */
.atts__sub { margin: 14px 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.atts--inline .att { padding: 4px 6px; }
.atts--inline .att__thumb { width: 36px; height: 36px; }
.att__where { color: var(--brand); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.att__where:hover { text-decoration: underline; }
span.att__where, .att__where:not([href]) { color: var(--muted); }

/* =================================================================== M6: Inbox */
.phead__icon--inbox { --c: var(--navy); }
.tabs__count--brand { background: var(--brand); color: #fff; }
.ibx-wrap { padding-top: 4px; }
.ibx { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.ibx__item {
   display: grid; grid-template-columns: 10px 32px minmax(0, 1fr) auto; gap: 12px; align-items: start;
   padding: 12px 8px; border-bottom: 1px solid var(--border); transition: background .15s, opacity .18s;
}
.ibx__item:hover { background: var(--bg-hover); }
.ibx__item.is-leaving { opacity: 0; }
.ibx__dot { width: 8px; height: 8px; margin-top: 12px; border-radius: 50%; background: transparent; }
.ibx__item.is-unread .ibx__dot { background: var(--brand); }
.ibx__item .avatar { width: 32px; height: 32px; }
.ibx__main { min-width: 0; }
.ibx__top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ibx__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.ibx__title:hover { text-decoration: underline; }
.ibx__item.is-unread .ibx__title { font-weight: 900; color: var(--text); }
.ibx__item.is-done .ibx__title { text-decoration: line-through; color: var(--muted); }
.ibx__project { flex: none; }
.ibx__what { margin-top: 2px; color: var(--muted); font-size: 13px; }
.ibx__who { color: var(--text-2); }
.ibx__what a { color: var(--text-2); text-decoration: underline; }
.ibx__item.is-mention .ibx__what { color: var(--brand); }
.ibx__snippet {
   margin-top: 4px; color: var(--text-2); font-size: 13px; line-height: 1.45;
   display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ibx__side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ibx__time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ibx__archive { opacity: 0; }
.ibx__item:hover .ibx__archive, .ibx__archive:focus-within { opacity: 1; }
.lrow.is-open, .ibx__item:has(.ibx__title:focus) { background: var(--brand-soft); }

/* home: menzioni non lette */
.trow.is-unread .trow__title { font-weight: 900; }
.trow.is-unread .trow__title::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--brand); vertical-align: middle; }
.home__stats a:hover { text-decoration: underline; }

@media (max-width: 768px) {
   .ibx__item { grid-template-columns: 8px 28px minmax(0, 1fr); padding: 12px 6px; gap: 10px; }
   .ibx__item .avatar { width: 28px; height: 28px; }
   .ibx__side { grid-column: 3; flex-direction: row; justify-content: space-between; align-items: center; }
   .ibx__archive { opacity: 1; }
   .ibx__project { display: none; }
}
.ibx__item { cursor: pointer; }
.ibx__item.is-open, .ibx__item:active { background: var(--brand-soft); }

/* campi del task come tabella di proprietà: etichetta | valore, una riga per campo */
.fields {
   grid-template-columns: 132px minmax(0, 1fr); row-gap: 0; align-items: stretch;
   border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 22px;
}
.fields__label {
   display: flex; align-items: center; padding: 0 12px; min-height: 42px;
   background: var(--bg-soft); color: var(--text-2); font-size: 13px; font-weight: 700;
   border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
}
.fields__value { min-height: 42px; padding: 4px 8px; border-bottom: 1px solid var(--border); background: #fff; }
.fields > :nth-last-child(-n+2) { border-bottom: 0; }
.fields__value--text { padding-left: 12px; color: var(--text-2); }
.fields .fselect, .fields .fdate { color: var(--text); }
.fields__value:hover { background: #fcfcfd; }
.fields .fdate:not(:focus):invalid, .fields .fdate[value=""] { color: var(--muted); }

@media (max-width: 768px) {
   .fields { grid-template-columns: 104px minmax(0, 1fr); }
   .fields__label { padding: 0 10px; font-size: 12px; }
}

/* pagina intera: senza "Apri a pagina intera" il menu può restare vuoto, e allora non si mostra */
.taskpage .tpane__more:not(:has(.menu__item:not(.js-open-full))) { display: none; }

/* =================================================================== M7: nome del progetto, archivio */
.phead__rename { min-width: 0; }
.phead__titleinput {
   display: block; max-width: 100%; margin-left: -6px; padding: 0 6px; height: 30px;
   border: 1px solid transparent; border-radius: 6px; background: none; font: inherit; font-size: 20px; font-weight: 700; color: var(--text);
}
.phead__titleinput:hover { border-color: var(--border); }
.phead__titleinput:focus { outline: none; border-color: var(--brand); background: #fff; }
.phead__more { position: relative; align-self: flex-end; margin-bottom: 2px; }
.archived-banner { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 24px; background: #fff6e0; color: #7a5a00; font-size: 13px; border-bottom: 1px solid #f1e2b8; }
.archived-banner span { flex: 1; }
.archived-box { margin-top: 18px; }
.archived-box summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.archived-box summary:hover { color: var(--text); }
.ptiles--archived { margin-top: 10px; opacity: .75; }

/* =================================================================== M7: board */
.ltable--board {
   display: flex; align-items: flex-start; gap: 12px; overflow-x: auto;
   padding: 6px 24px 24px; min-height: calc(100vh - 230px);
   scroll-snap-type: x proximity;
}
.ltable--board .ltable__head { display: none; }
.ltable--board .lsection {
   flex: 0 0 286px; margin: 0; padding: 6px 8px 8px; border-radius: 10px; background: var(--bg-soft);
   display: flex; flex-direction: column; max-height: calc(100vh - 240px); scroll-snap-align: start;
}
.ltable--board .lsection__caret { display: none; }
.ltable--board .lsection__head { height: 36px; padding-left: 2px; }
.ltable--board .lsection__name { font-size: 14px; }
.ltable--board .lsection.is-collapsed .lrows, .ltable--board .lsection.is-collapsed .ladd { display: flex; }
.ltable--board .lrows {
   display: flex; flex-direction: column; gap: 8px; min-height: 12px; padding: 2px; margin: 0 -2px;
   overflow-y: auto; border-top: 0;
}
.ltable--board .lrow {
   position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto;
   grid-template-areas: "check name name" ". who due"; align-items: start;
   min-height: 0; padding: 10px 10px 8px 6px; border: 1px solid var(--border); border-radius: 8px;
   background: #fff; box-shadow: 0 1px 2px rgba(20, 22, 33, .05); cursor: grab;
}
.ltable--board .lrow:hover { border-color: var(--border-strong); background: #fff; box-shadow: 0 3px 10px rgba(20, 22, 33, .08); }
.ltable--board .lrow.is-open { background: var(--brand-soft); border-color: #f0bcd4; }
.ltable--board .lrow__check { grid-area: check; padding-top: 1px; }
.ltable--board .lrow__name { grid-area: name; height: auto; align-items: flex-start; flex-wrap: wrap; gap: 4px; }
.ltable--board .lrow__title {
   flex: 1 1 100%; padding: 0 22px 0 0; white-space: normal; line-height: 1.35;
   display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.ltable--board .lrow__sub { padding: 0; }
.ltable--board .lrow__more { position: absolute; top: 4px; right: 4px; margin: 0; }
.ltable--board .lrow__who, .ltable--board .lrow__due { height: auto; margin-top: 8px; padding: 0; border: 0; }
.ltable--board .lrow__who { grid-area: who; }
.ltable--board .lrow__whoname { display: none; }
.ltable--board .lrow__due { grid-area: due; justify-self: end; font-size: 12px; }
.ltable--board .lrow__who:empty, .ltable--board .lrow__due:empty { margin-top: 0; }
.ltable--board .lrow.drop-before { box-shadow: 0 -3px 0 var(--brand), 0 1px 2px rgba(20, 22, 33, .05); }
.ltable--board .lsection.drop-end { outline: 2px dashed var(--brand); outline-offset: -2px; }
.ltable--board .lsection.drop-end .lrows { box-shadow: none; }
.ltable--board .ladd { flex: none; margin-top: 6px; height: 36px; padding: 0 6px; border-radius: 8px; border: 0; }
.ltable--board .ladd:hover, .ltable--board .ladd:focus-within { background: #fff; }
.ltable--board .add-section {
   flex: 0 0 240px; margin: 0; height: 46px; padding: 0 10px;
   border: 1px dashed var(--border-strong); border-radius: 10px;
}

/* =================================================================== M7: ricerca */
.phead__icon--search { --c: var(--accent); }
.results { padding-top: 4px; }
.results__group { margin: 8px 0 26px; }
.results__head { margin: 0 0 10px; font-size: 15px; }
.hits { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.hit { display: flex; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--border); cursor: pointer; }
.hit:hover { background: var(--bg-hover); }
.hit__check { margin-top: 2px; }
.hit.is-done .hit__check { background: var(--accent); border-color: var(--accent); color: #fff; }
.hit__main { min-width: 0; flex: 1; }
.hit__top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hit__title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit__title:hover { text-decoration: underline; }
.hit.is-done .hit__title { color: var(--muted); }
.hit__project { flex: none; }
.hit__where { margin-top: 3px; color: var(--muted); font-size: 12px; }
.hit__snippet { margin-top: 2px; color: var(--text-2); font-size: 13px; }
mark { background: #fff1a8; color: inherit; border-radius: 2px; padding: 0 1px; }
.ptile__text { display: flex; flex-direction: column; min-width: 0; }
.ptile__sub { color: var(--muted); font-size: 12px; }
.ptile__icon--team { background: var(--accent-soft); color: #067a76; }

/* suggerimenti sotto la barra di ricerca */
.suggest {
   position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; padding: 6px 0;
   background: #fff; color: var(--text); border-radius: 8px; box-shadow: var(--shadow-menu);
}
.suggest__item, .suggest__all { display: flex; align-items: center; gap: 10px; padding: 8px 14px; }
.suggest__item:hover, .suggest__item.is-active, .suggest__all:hover, .suggest__all.is-active { background: var(--brand-soft); }
.suggest__check { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border-strong); }
.suggest__item.is-done .suggest__check { background: var(--accent); border-color: var(--accent); }
.suggest__item .dot { width: 12px; height: 12px; }
.suggest__label { flex: none; max-width: 65%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest__sub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; text-align: right; }
.suggest__all { margin-top: 4px; border-top: 1px solid var(--border); color: var(--brand); font-size: 13px; font-weight: 700; }

@media (max-width: 768px) {
   .ltable--board { padding: 6px 10px 20px; scroll-snap-type: x mandatory; }
   .ltable--board .lsection { flex-basis: 84vw; }
   .ltable--board .lrow__more { opacity: 1; }
   .phead__titleinput { font-size: 18px; }
   .archived-banner { padding: 10px 14px; flex-wrap: wrap; }
   .hit__project { display: none; }
}

/* immagini nei testi con dimensioni note: spazio riservato, nessun salto */
.cm__body img[width][height], .rte__body img[width][height] { height: auto; aspect-ratio: attr(width type(<number>)) / attr(height type(<number>)); }
.cm__body img, .rte__body img { background: var(--bg-soft); }

/* =================================================================== M8: notifiche */
.phead__icon--settings { --c: var(--brand); }
.settings__body { max-width: 860px; padding: 20px 24px 60px; }
.avatar--xl { width: 64px; height: 64px; font-size: 22px; }
.profile { display: flex; align-items: center; gap: 16px; padding: 18px; border: 1px solid var(--border); border-radius: 10px; }
.profile__name { font-size: 18px; font-weight: 900; }
.profile__mail { color: var(--text-2); }
.profile__note { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.settings__saved { display: flex; align-items: center; gap: 6px; margin: 16px 0 0; padding: 10px 12px; border-radius: 6px; background: var(--accent-soft); color: #067a76; }
.prefs { margin-top: 26px; }
.prefs__title { margin: 0 0 4px; font-size: 18px; }
.prefs__intro { margin: 0 0 16px; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.prefs__table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.prefs__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.prefs__row:last-child { border-bottom: 0; }
.prefs__label { display: flex; flex-direction: column; min-width: 0; }
.prefs__label span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.prefs__seg { flex: none; }
.prefs__seg .seg__opt { cursor: pointer; }
.prefs__seg input { position: absolute; opacity: 0; pointer-events: none; }
.prefs__seg .seg__opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.prefs__select { width: auto; flex: none; }
.prefs__pause { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.prefs__pause input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }
.prefs.is-paused .prefs__table { opacity: .45; }
.prefs__actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 20px; }
.prefs__off { margin-right: auto; color: var(--muted); font-size: 12px; }

@media (max-width: 768px) {
   .settings__body { padding: 14px 12px 40px; }
   .prefs__row { flex-direction: column; align-items: stretch; gap: 10px; }
   .prefs__seg { width: 100%; }
   .prefs__seg .seg__opt { flex: 1; justify-content: center; }
   .prefs__select { width: 100%; }
}

/* =================================================================== M8b: cronologia della descrizione */
.tsec__head { gap: 10px; }
.tsec__head .tsec__title { margin-right: auto; }
.tsec__link { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }
.tsec__link:hover { color: var(--text); text-decoration: underline; }

.modal { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; padding: 24px; background: rgba(16, 18, 26, .55); animation: lb-in .15s var(--ease); }
.modal__box { width: min(1000px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: hidden; }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--border); }
.modal__title { margin: 0; flex: 1; font-size: 17px; }
.modal__body { flex: 1; min-height: 0; overflow: hidden; display: flex; }

.hist { display: flex; width: 100%; min-height: 0; }
.hist__list { flex: none; width: 260px; overflow-y: auto; border-right: 1px solid var(--border); background: var(--bg-soft); padding: 6px; }
.hist__item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; color: var(--text-2); }
.hist__item small { color: var(--muted); font-size: 12px; }
.hist__item:hover { background: var(--bg-hover); }
.hist__item.is-active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(20, 22, 33, .1); }
.hist__view { flex: 1; min-width: 0; overflow-y: auto; padding: 14px 22px 26px; }
.hist__tabs { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.hist__tab { position: relative; padding: 6px 0 10px; color: var(--muted); font-weight: 700; }
.hist__tab.is-active { color: var(--text); }
.hist__tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }
.hist__restore { margin-left: auto; padding-bottom: 6px; }
.hist__note { color: var(--muted); font-size: 13px; }
.hist__diff { white-space: pre-wrap; line-height: 1.7; font-size: 14px; }
.hist__diff ins, .hist__note ins { background: #dcf5e3; color: #1d6b3c; text-decoration: none; border-radius: 3px; padding: 0 1px; }
.hist__diff del, .hist__note del { background: #fde3e1; color: #a3322a; border-radius: 3px; padding: 0 1px; }

@media (max-width: 768px) {
   .modal { padding: 0; }
   .modal__box { max-height: 100vh; height: 100%; border-radius: 0; }
   .hist { flex-direction: column; }
   .hist__list { width: auto; max-height: 34vh; border-right: 0; border-bottom: 1px solid var(--border); }
   .hist__view { padding: 12px 14px 24px; }
   .hist__tabs { flex-wrap: wrap; }
}

/* =================================================================== sottotask annidati e albero */
.lrow__toggle {
   flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; margin: 0 2px 0 -4px;
   border-radius: 4px; color: var(--muted);
}
.lrow__toggle:hover { background: var(--border); color: var(--text); }
.lrow__toggle .ic { transform: rotate(-90deg); transition: transform .15s; }
.lrow.is-expanded > .lrow__name .lrow__toggle .ic { transform: none; }
.lrow--sub { background: #fcfcfd; }
.lrow--sub > .lrow__check { transform: translateX(calc(var(--depth, 1) * 22px)); }
.lrow--sub > .lrow__name { padding-left: calc(var(--depth, 1) * 22px); }
.lrow--sub .lrow__title { color: var(--text-2); }
.lrow.drop-into { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); border-radius: 4px; }
.subs .lrow__toggle, .ltable--board .lrow__toggle, .ltable[data-rowmode=mine] .lrow__toggle { display: none; }

.picker { width: 100%; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.picker__list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 50vh; border: 1px solid var(--border); border-radius: 8px; }
.picker__list:empty { display: none; }
.picker__item { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.picker__item:hover { background: var(--brand-soft); }
.picker__item.is-done .picker__title { color: var(--muted); text-decoration: line-through; }
.picker__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.picker__sub { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.picker__empty { padding: 12px; color: var(--muted); }
.picker__hint { margin: 0; color: var(--muted); font-size: 12px; }
.modal__body:has(.picker) { overflow: visible; }
.modal__box:has(.picker) { width: min(560px, 100%); }

/* avanzamento del progetto e contatore dei sottotask */
.lrow__sub b { font-weight: 700; }
.lrow__sub.is-complete { color: #078d88; }
.ptoolbar button.ptoolbar__link { padding: 0; }
.pprogress { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.pprogress b { color: var(--text); }
.pprogress__bar { width: 140px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.pprogress__bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
@media (max-width: 768px) {
   .pprogress { width: 100%; margin-left: 0; order: 4; }
   .pprogress__bar { flex: 1; }
}

/* cerchio dell'avanzamento dei sottotask: si riempie a mano a mano che si chiudono, pieno quando sono tutti fatti */
.ring {
   --p: 0; display: inline-block; width: 12px; height: 12px; margin-left: 4px; border-radius: 50%;
   background: conic-gradient(var(--accent) calc(var(--p) * 1%), transparent 0);
   box-shadow: inset 0 0 0 1.5px var(--accent);
   vertical-align: -1px;
}
.lrow__sub.is-complete .ring { background: var(--accent); }

/* =================================================================== amministrazione */
.phead__icon--admin { --c: var(--navy); }
.adminpage__body { padding: 18px 24px 50px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; }
.stat b { display: block; font-size: 24px; font-weight: 900; }
.stat span { color: var(--muted); font-size: 12px; }
.adminpage__note { margin: 14px 0 18px; color: var(--muted); font-size: 13px; }
.atable { width: 100%; border-collapse: collapse; font-size: 14px; }
.atable th { text-align: left; padding: 8px 10px; color: var(--muted); font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--border); }
.atable td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.atable tr:hover td { background: var(--bg-hover); }
.atable .num { text-align: right; white-space: nowrap; }
.atable__name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.atable__name:hover { text-decoration: underline; }
.atable__person { display: inline-flex; align-items: center; gap: 8px; }
.atable tr.is-archived td { color: var(--muted); }
.badge--muted { background: var(--bg-soft); color: var(--muted); }
@media (max-width: 768px) {
   .adminpage__body { padding: 14px 10px 40px; overflow-x: auto; }
   .atable { min-width: 620px; }
}

/* vista predefinita: nota accanto alle schede quando si guarda l'altra */
.tabs__note { margin-left: auto; align-self: center; font-size: 12px; color: var(--muted); }

/* scorciatoie da tastiera */
.lrow.is-kbd, .ibx__item.is-kbd { box-shadow: inset 3px 0 0 var(--brand); background: var(--brand-soft); }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
   background: #fff; font: 600 12px/18px inherit; font-family: inherit; text-align: center; color: var(--text-2); }
.menu__kbd { margin-left: auto; }
.modal__box:has(.keys) { width: min(640px, 100%); }
.modal__body:has(.keys) { overflow: auto; }
.keys { padding: 8px 20px 20px; display: grid; align-content: start; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 28px; width: 100%; }
.keys__group h3 { margin: 14px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.keys__group dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; }
.keys__group dt { white-space: nowrap; }
.keys__group dd { margin: 0; font-size: 14px; }
@media (hover: none) { [data-shortcuts] { display: none; } }

/* menu del progetto: su schermi stretti il pulsante è vicino al bordo destro, il menu si apre verso sinistra */
@media (max-width: 900px) { .phead__more .menu { left: auto; right: 0; } }

/* Inbox: contesto della notifica */
.ibx__parent { margin-top: 1px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibx__parent span { color: var(--text-2); }
.ibx__context { margin-top: 6px; padding: 2px 0 2px 10px; border-left: 3px solid var(--border); color: var(--muted); font-size: 13px; line-height: 1.45; }
.ibx__ctxline { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ibx__ctxline + .ibx__ctxline { margin-top: 3px; }
.ibx__ctxlabel { font-weight: 700; color: var(--text-2); }
.ibx__ctxlabel::after { content: ":"; }
.ibx__ctxline.is-mine .ibx__ctxlabel { color: #07928d; }
.ibx__ev + .ibx__ev { margin-top: 6px; }
.ibx__events { margin-top: 4px; }
.ibx__events .ibx__what { margin-top: 0; }
.ibx__more { margin-top: 4px; color: var(--muted); font-size: 12px; }

/* tutta la riga di un task è cliccabile */
.lrow, .trow { cursor: pointer; }

/* ---------- filtri e ordinamento ---------- */
.pmenu { position: relative; }
.pmenu__btn {
   display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
   border-radius: 6px; color: var(--muted); font-size: 13px; white-space: nowrap;
   max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
.pmenu__btn:hover { background: var(--bg-hover); color: var(--text); }
.pmenu__btn.is-on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.pmenu__btn.is-on .ic { color: var(--brand); }
.menu--scroll { max-height: min(70vh, 520px); overflow-y: auto; }
.menu__tick { visibility: hidden; color: var(--brand) !important; }
.pmenu .menu__item.is-current { color: var(--text); font-weight: 700; cursor: pointer; }
.pmenu .menu__item.is-current::after { content: none; }
.menu__item.is-current .menu__tick { visibility: visible; }
.checkrow { display: flex; align-items: center; gap: 8px; margin-top: 10px; cursor: pointer; }
.checkrow input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- calendario ---------- */
.cal { padding: 0 24px 40px; }
.cal__bar { display: flex; align-items: center; gap: 4px; padding: 4px 0 12px; }
.cal__prev { transform: rotate(90deg); }
.cal__next { transform: rotate(-90deg); }
.cal__month { margin: 0 12px 0 6px; font-size: 18px; font-weight: 700; text-transform: capitalize; min-width: 150px; }
.cal__hint { margin-left: auto; color: var(--muted); font-size: 12px; }
.cal__grid {
   display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
   border-top: 1px solid var(--border); border-left: 1px solid var(--border);
}
.cal__dow {
   padding: 6px 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
   color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.cal__day {
   position: relative; min-height: 118px; padding: 4px 4px 6px;
   border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
   display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.cal__dow--we, .cal__day.is-weekend { background: var(--bg-soft); }
.cal__day.is-other .cal__num { color: var(--border-strong); }
.cal__day.is-drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.cal__head { display: flex; align-items: center; justify-content: space-between; height: 24px; padding-left: 4px; }
.cal__num { font-size: 12px; color: var(--text-2); }
.cal__num b { font-weight: 700; }
.cal__wd { display: none; }
.cal__day.is-today .cal__num b {
   display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
   border-radius: 11px; background: var(--brand); color: #fff;
}
.cal__plus { opacity: 0; transition: opacity .12s; width: 22px; height: 22px; }
.cal__day:hover .cal__plus, .cal__plus:focus-visible { opacity: 1; }
.cal__tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cal__task {
   display: flex; align-items: center; gap: 6px; min-width: 0; padding: 3px 6px;
   border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 12px; cursor: pointer;
}
.cal__task:hover { border-color: var(--border-strong); box-shadow: 0 1px 3px rgba(20, 22, 33, .08); }
.cal__task.is-open { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.cal__task.is-dragging { opacity: .4; }
.cal__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--border-strong)); }
.cal__who { flex: none; width: 16px; height: 16px; font-size: 7px; }
.cal__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cal__task.is-done .cal__title { color: var(--muted); text-decoration: line-through; }
.cal__task.is-late { border-color: #f1c4c0; background: #fdf3f2; }
.cal__task.is-late .cal__title { color: var(--late); }
.cal__add { margin-top: 2px; }
.cal__input {
   width: 100%; height: 28px; padding: 0 6px; border: 1px solid var(--brand); border-radius: 6px;
   background: #fff; font-size: 12px;
}
.cal__input:focus { outline: none; box-shadow: 0 0 0 2px var(--brand-soft); }

@media (max-width: 768px) {
   .cal { padding: 0 12px 40px; }
   .cal__hint { display: none; }
   .cal__grid { display: block; border: 0; }
   .cal__dow { display: none; }
   /* su telefono: elenco dei giorni del mese con task, più oggi */
   .cal__day { min-height: 0; border: 0; border-bottom: 1px solid var(--border); padding: 8px 0; background: none !important; }
   .cal__day.is-other, .cal__day:not(.has-tasks):not(.is-today) { display: none; }
   .cal__wd { display: inline; text-transform: capitalize; }
   .cal__plus { opacity: 1; }
   .cal__task { font-size: 14px; padding: 8px 10px; }
}
