/* Hex Archive — gestionale. Tema scuro, grigio/nero, ispirato a hexarchive.com */
:root {
  --bg: #0a0a0b;
  --panel: #111113;
  --panel-2: #161618;
  --line: #242427;
  --line-2: #34343a;
  --text: #e8e8e6;
  --muted: #8a8a90;
  --faint: #5b5b61;
  --accent: #f2f2f0;
  --danger: #d27a7a;
  --ok: #8fb99a;
  --warn: #cfb27a;
  --radius: 6px;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 300; letter-spacing: .01em; margin: 0; }
h2 { font-size: 20px; } h3 { font-size: 17px; font-weight: 500; }
a { color: var(--text); }
::selection { background: #3a3a40; }
.eyebrow { font: 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .18em; color: var(--muted); margin: 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------- font titoli: Akira Expanded (fornito dal proprietario; verificare la licenza per uso commerciale) ---------- */
@font-face { font-family: 'Akira'; src: url('/assets/fonts/akira-bold.woff') format('woff'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'Akira Super'; src: url('/assets/fonts/akira-super-bold.woff') format('woff'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Akira Outline'; src: url('/assets/fonts/akira-outline.woff') format('woff'); font-weight: 400; font-display: swap; }
:root { --display: 'Akira', var(--sans); }
h1 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .06em; font-size: 23px; line-height: 1.25; }
.auth-card h1 { font-size: 15px; margin-bottom: 10px; }
.brand b { font-family: var(--display); font-weight: 400; font-size: 10px; letter-spacing: .14em; }

/* ---------- controlli ---------- */
label { display: block; font: 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 18px 0 8px; }
input, select { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 10px 12px; font: inherit; outline: none; transition: border-color .15s; }
input:focus, select:focus { border-color: #8a8a90; }
input::placeholder { color: var(--faint); }
button { font: inherit; cursor: pointer; border-radius: var(--radius); padding: 10px 16px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text); transition: background .15s, border-color .15s; }
button:hover { background: var(--panel-2); border-color: #55555c; }
button.primary { background: var(--accent); color: #0a0a0b; border-color: var(--accent); font-weight: 500; }
button.primary:hover { background: #fff; }
button.danger { color: var(--danger); } button.small { padding: 5px 10px; font-size: 12px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; } .row > * { flex: 1 1 160px; }
.row > button { flex: 0 0 auto; }
.msg { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line-2); font-size: 13px; }
.msg.error { border-color: #5a3434; color: var(--danger); background: #1a1111; }
.msg.ok { border-color: #34473a; color: var(--ok); background: #101611; }
.msg.info { color: var(--muted); }

/* ---------- pagine di accesso ---------- */
body.auth { display: grid; place-items: center; min-height: 100%; padding: 24px;
  background: radial-gradient(900px 500px at 50% -10%, #17171a 0%, var(--bg) 70%); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .logo { display: block; height: 120px; margin: 0 auto 18px; opacity: .92; }
.auth-card .eyebrow { text-align: center; margin-bottom: 28px; }
.auth-card .card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 26px 26px 28px; }
.auth-card button.primary { width: 100%; margin-top: 22px; }
.secret { font: 15px/1.6 var(--mono); letter-spacing: .12em; padding: 12px; background: var(--bg); border: 1px dashed var(--line-2);
  border-radius: var(--radius); word-break: break-all; user-select: all; text-align: center; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.codes span { font: 14px var(--mono); letter-spacing: .1em; text-align: center; padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); user-select: all; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 13px; color: var(--muted); }
.check input { width: auto; margin-top: 3px; }

/* ---------- applicazione ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100%; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.brand img { height: 46px; opacity: .92; }
.brand b { display: block; font: 600 11px/1.3 var(--mono); letter-spacing: .2em; text-transform: uppercase; }
.brand small { font: 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { text-decoration: none; padding: 9px 12px; border-radius: var(--radius); color: var(--muted); border-left: 2px solid transparent; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.active { color: var(--accent); background: var(--panel-2); border-left-color: var(--accent); }
.who { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.who .eyebrow { margin: 4px 0 10px; }
main { padding: 34px 40px 60px; max-width: 1180px; width: 100%; min-width: 0; }
.pagehead { margin-bottom: 26px; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); } .pagehead p { margin: 6px 0 0; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px; margin-bottom: 20px; }
.placeholder { border-style: dashed; color: var(--muted); }
.placeholder ul { margin: 12px 0 0; padding-left: 18px; } .placeholder li { margin: 4px 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); padding: 10px 14px; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs button:hover { background: transparent; color: var(--text); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 400; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.tag { display: inline-block; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 99px; color: var(--muted); }
.tag.ok { color: var(--ok); border-color: #34473a; } .tag.warn { color: var(--warn); border-color: #4d4330; } .tag.off { color: var(--danger); border-color: #5a3434; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.linkbox { display: flex; gap: 8px; margin-top: 10px; } .linkbox input { font: 12px var(--mono); }
.scroll { overflow-x: auto; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; }
  .brand { border: none; padding: 0; margin: 0; } .nav { flex-direction: row; flex-wrap: wrap; } .who { margin: 0 0 0 auto; border: none; padding: 0; }
  main { padding: 22px 16px 40px; }
}

/* ---------- fatture ---------- */
.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar > div { flex: 0 1 170px; } .toolbar > div.grow { flex: 1 1 220px; } .toolbar > button { flex: 0 0 auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.kpi b { display: block; font: 300 20px var(--sans); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi.alert { border-color: #4d4330; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.month td { background: var(--panel-2); border-bottom: 1px solid var(--line-2); padding: 10px 12px; }
tr.month.current td:first-child { border-left: 2px solid var(--accent); }
tr.month b { font-weight: 500; }
tr.unassigned td { background: #15130d; }
tr.excluded td { opacity: .5; } tr.excluded td.client, tr.excluded td.num > b { text-decoration: line-through; }
td select, td input[type="text"] { padding: 5px 8px; font-size: 13px; }
td select { width: auto; min-width: 132px; }
td input[type="text"] { min-width: 150px; }
td.tight { width: 1%; white-space: nowrap; }
td.client { min-width: 130px; }
.cell-sub { display: block; font-size: 12px; color: var(--faint); }
.bulkbar { display: flex; gap: 10px; align-items: center; padding: 10px 12px; margin-bottom: 14px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel-2); }
.bulkbar select { width: auto; }
.mt { margin-top: 14px; }
.card h2 + .muted { margin: 6px 0 14px; }
.btn-link { background: none; border: none; color: var(--muted); text-decoration: underline; padding: 0; cursor: pointer; }

/* classi di utilità (la CSP non consente stili in linea) */
.mt6 { margin-top: 6px; } .mt10 { margin-top: 10px; } .mt16 { margin-top: 16px; } .mt18 { margin-top: 18px; } .mb10 { margin-bottom: 10px; }
.fs12 { font-size: 12px; }
.check span { text-transform: none; letter-spacing: 0; font: 13px var(--sans); }
table.inv th, table.inv td { padding-left: 8px; padding-right: 8px; }
table.inv td select { min-width: 118px; }
table.inv td input[type="text"] { min-width: 110px; }

/* codice QR per l'app Authenticator: sfondo chiaro obbligatorio per essere letto */
.qr { width: 260px; height: 260px; margin: 18px auto 4px; padding: 14px; background: #fff; border-radius: var(--radius); }
.qr svg { display: block; width: 100%; height: 100%; }
td input.codes { margin-top: 6px; font: 12px var(--mono); }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.card.warn { border-color: #4d4330; margin-bottom: 14px; }
.ledger { width: 100%; border-collapse: collapse; margin-top: 8px; }
.ledger td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.ledger td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger tr.sub td { color: var(--muted); font-size: 12px; padding-left: 14px; }
.ledger tr.total td { font-weight: 600; border-bottom: 0; padding-top: 12px; }
.neg { color: var(--danger); }

/* Board dei progetti */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-height: 140px; }
.kcol > header { display: flex; justify-content: space-between; padding: 12px 14px; font: 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; border-bottom: 1px solid var(--line); }
.kbody { padding: 10px; display: grid; gap: 10px; }
.kempty { margin: 6px 4px; font-size: 12px; }
.pcard { background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 12px 13px; cursor: pointer; display: grid; gap: 6px; }
.pcard:hover, .pcard:focus-visible { border-color: var(--muted); outline: none; }
.pcard[draggable="true"] { cursor: grab; }
.ptitle { font-weight: 600; }
.pmeta { font-size: 12px; color: var(--muted); }
.due-soon { color: var(--warn); } .due-over { color: var(--danger); }
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .62); z-index: 50; display: flex; justify-content: flex-end; }
.drawer { width: min(600px, 100%); height: 100%; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line-2); padding: 22px 24px; }
.dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.dhead h2 { margin: 6px 0 0; }
.people { display: grid; gap: 6px; margin: 6px 0 14px; }
.check { display: flex; gap: 8px; align-items: center; text-transform: none; letter-spacing: 0; font: 14px var(--sans); color: var(--text); }
.check input { width: auto; }
.facts dt { font: 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-top: 16px; }
.facts dd { margin: 6px 0 0; } .pre { white-space: pre-wrap; }
textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 9px 11px; font: 14px var(--sans); resize: vertical; }
.pcard .tag { justify-self: start; }

/* Commenti e notifiche */
.comments { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 16px; }
.comments h3 { margin: 0 0 10px; font-weight: 400; }
.comment { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment header { display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.comment p { margin: 6px 0 0; white-space: pre-wrap; }
.mention { color: #9ec1ff; background: #14202f; border-radius: 4px; padding: 0 4px; }
.linklike { margin-left: auto; background: none; border: none; color: var(--muted); }
.ac-wrap { position: relative; }
.ac { position: absolute; left: 0; right: 0; bottom: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); z-index: 5; display: grid; }
.ac button { text-align: left; background: none; border: none; color: var(--text); padding: 8px 12px; }
.ac button:hover { background: #1b1b1f; }
.bellwrap { position: fixed; top: 16px; right: 22px; z-index: 40; }
.bellbtn { position: relative; width: 42px; height: 42px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--panel); border: 1px solid var(--line-2); }
.bellbtn .badge { position: absolute; top: -5px; right: -5px; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #d27a7a; color: #0a0a0b; font: 11px/18px var(--mono); text-align: center; }
.npanel { position: absolute; top: 52px; right: 0; width: 330px; max-height: 60vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; z-index: 60; }
.nhead { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.nitem { display: grid; gap: 3px; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--line); color: var(--text); padding: 10px 12px; font: 13px var(--sans); }
.nitem.unread { background: #14161b; }
.nitem:hover { background: #1b1b1f; }
.npad { padding: 14px; margin: 0; }

/* Finestra grande del progetto e ingranaggio sul riquadro */
.overlay.center { justify-content: center; align-items: center; }
.pbig { width: min(1100px, 96vw); height: min(88vh, 900px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 24px 28px; }
.bhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.bhead h2 { margin: 10px 0 0; font-size: 26px; font-weight: 400; }
.bhead p { margin: 4px 0 0; }
.bactions { display: flex; gap: 8px; align-items: center; }
.bactions select { width: auto; min-width: 150px; }
.iconbtn { display: inline-flex; padding: 7px 9px; }
.binfo { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.binfo p { margin: 8px 0 0; }
.bfact b { display: block; font-weight: 400; font-size: 17px; margin-top: 8px; }
.pcard { position: relative; }
.pcard .ptitle { padding-right: 30px; }
.gear { position: absolute; top: 8px; right: 8px; display: inline-flex; padding: 5px; background: none; border: 1px solid transparent; border-radius: 6px; color: var(--muted); }
.gear:hover, .gear:focus-visible { color: var(--text); border-color: var(--line-2); outline: none; }
@media (max-width: 800px) { .binfo { grid-template-columns: 1fr; } }

/* Immagine profilo */
.whobox { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.whotxt { min-width: 0; } .whoname { overflow-wrap: anywhere; } .whobox .eyebrow { margin: 2px 0 0; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--panel-2, #26262b); border: 1px solid var(--line-2); font-size: 13px; letter-spacing: .04em; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.big { width: 84px; height: 84px; font-size: 24px; }
.avrow { align-items: center; gap: 18px; margin-bottom: 14px; }

/* Registro attività */
.regbar { align-items: flex-end; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.regsep { width: 1px; align-self: stretch; background: var(--line-2); margin: 0 8px; }
.regday { margin: 22px 0 8px; font-weight: 400; text-transform: capitalize; }
.redx { color: #e05252; font-weight: 700; }
td.xcol, th.xcol { width: 22px; padding-right: 0; }
tr.undone td { opacity: .6; }
tr.undone td.xcol { opacity: 1; }

/* Codice cliente e codice progetto */
.code3 { width: 5.5em; text-transform: uppercase; letter-spacing: .12em; text-align: center; }
.codebox { display: flex; align-items: center; gap: 6px; }
.codepre { font-family: var(--mono); letter-spacing: .1em; color: var(--muted); }
.avatar.default img { object-fit: contain; padding: 15%; }

/* ---------- Scheda progetto: avanzamento, Discord, note, steps, report ---------- */
.pbar { width: 100%; height: 8px; border: none; border-radius: 4px; background: var(--line-2); overflow: hidden; vertical-align: middle; accent-color: #6fbf8f; }
.pbar::-webkit-progress-bar { background: var(--line-2); }
.pbar::-webkit-progress-value { background: #6fbf8f; border-radius: 4px; }
.pbar::-moz-progress-bar { background: #6fbf8f; border-radius: 4px; }
.pprog { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; }
.pprog .pbar { flex: 1; min-width: 40px; }
.pprog.big { margin: 0 0 14px; font-size: 14px; gap: 12px; }
.pprog.big .pbar { max-width: 360px; }
.linkbtn, a.iconbtn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 11px; background: transparent; font-size: 13px; }
.linkbtn:hover, a.iconbtn:hover { background: var(--panel-2); border-color: #55555c; }
a.discord { color: #8c9eff; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--c, transparent); vertical-align: middle; }
.person { display: inline-flex; align-items: center; margin-right: 10px; }
.notes, .steps, .report { border-top: 1px solid var(--line); padding: 14px 0; }
.collapse { background: none; border: none; padding: 0; font: inherit; color: var(--text); letter-spacing: .06em; text-transform: uppercase; font-size: 12px; cursor: pointer; }
.notes-body { margin-top: 10px; } .notes-body textarea { width: 100%; }
.sechead { display: flex; align-items: baseline; gap: 12px; } .sechead h3 { margin: 0 0 8px; }
.step { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: var(--panel-2); }
.stephead { display: flex; align-items: center; gap: 8px; } .stephead b, .stepname { flex: 1; }
.stepdesc { width: 100%; margin-top: 8px; }
.stepnew { margin-top: 12px; align-items: flex-end; }
select.state { width: auto; min-width: 118px; }
.st-todo { border-color: #55555c; } .st-doing { border-color: #d6a84f; color: #e6c27a; } .st-blocked { border-color: #d27a7a; color: #e59a9a; }
.st-review { border-color: #4aa3df; color: #7cc0ee; } .st-done { border-color: #6fbf8f; color: #8fd3a9; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { border: 1px solid var(--line-2); border-radius: 12px; padding: 2px 10px; font-size: 12px; }
.rgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 8px 0 14px; }
.rbig { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; } .rbig b { display: block; font-size: 30px; font-weight: 400; margin: 6px 0; }
.rstates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 8px; }
.report h4 { margin: 18px 0 6px; font-weight: 400; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; color: var(--muted); }
.pcard .pprog { margin-top: 6px; } .pcard .pprog span { min-width: 34px; text-align: right; }
@media (max-width: 800px) { .rgrid, .rstates { grid-template-columns: 1fr; } }

/* ---------- Pagina asset list ---------- */
body.assetpage { padding: 18px 22px; }
.atop { display: block; margin-bottom: 14px; }
.abar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.atitle { margin: 10px 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.atools { margin-top: 12px; }
.atop h1 { margin: 2px 0 0; font-size: 22px; font-weight: 400; } .aactions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.aboard { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 20px; }
.acol { flex: none; width: 880px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px 12px; }
.achead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .acname { flex: 1; font-size: 15px; }
.vname { display: none; }
.acol.collapsed { width: 54px; padding: 8px 6px; cursor: default; }
.acol.collapsed .abody, .acol.collapsed .acname, .acol.collapsed .acount, .acol.collapsed [data-delcol] { display: none; }
.acol.collapsed .achead { flex-direction: column; align-items: center; }
.acol.collapsed .vname { display: block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; letter-spacing: .06em; margin-top: 6px; max-height: 60vh; overflow: hidden; text-overflow: ellipsis; }
.arow { display: grid; grid-template-columns: 1.3fr 1.5fr 118px 132px 118px 52px 52px 52px 28px; gap: 6px; align-items: center; padding: 3px 0 3px 8px; border-left: 3px solid var(--c, transparent); }
.arow input, .arow select { width: 100%; min-width: 0; }
.ahead { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-left-color: transparent; }
.aempty { padding: 8px; } [data-addrow] { margin-top: 8px; }

/* Colore personale */
.palette { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.swatch { box-sizing: border-box; width: 26px; height: 26px; border-radius: 50%; padding: 0; background: var(--c); border: 2px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--text); } .swatch:hover { border-color: var(--muted); }
.swatch.custom { display: inline-block; flex: none; box-sizing: border-box; position: relative; overflow: hidden; background: conic-gradient(#e06c75, #d6a84f, #6fbf8f, #4aa3df, #c678dd, #e06c75); }
.swatch.custom input { position: absolute; inset: -6px; width: 40px; height: 40px; opacity: 0; cursor: pointer; }
.avatar[data-color] { border-color: var(--c); box-shadow: 0 0 0 2px var(--c); }

/* BizDev */
.colact { display: inline-flex; gap: 6px; align-items: center; }
.gear2 { background: none; border: 0; color: var(--muted); padding: 2px 4px; cursor: pointer; font-size: 12px; min-height: 0; }
.gear2:hover { color: var(--text, #eee); }
.colname { font: inherit; text-transform: none; padding: 3px 6px; width: 100%; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bigtitle { font-size: 22px; font-weight: 600; width: 100%; }
.reminders { margin-top: 8px; }
.remlist { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; }
.remlist li { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13px; }
.remadd summary { cursor: pointer; font-size: 13px; color: var(--muted); margin: 6px 0; }
.remform { display: grid; gap: 8px; margin-top: 6px; }

/* La pagina dell'asset list usa tutta la larghezza della finestra (la regola generale di main la limitava a 1180px) */
.assetpage main, .assetpage .aboard { max-width: none; width: auto; }

.csteps { margin: 0; padding-left: 16px; font-size: 12px; color: var(--muted); display: grid; gap: 2px; }

/* Finestre di conferma e avviso del gestionale (dialog.js) */
.dlg { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dlgbox { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.dlgbox h3 { margin: 0 0 10px; font-size: 18px; font-weight: 400; }
.dlgbox p { margin: 0 0 20px; color: var(--muted); line-height: 1.5; }
.dlgact { display: flex; justify-content: flex-end; gap: 10px; }

.arow .num2 { text-align: center; padding-left: 4px; padding-right: 4px; }
.afoot { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 13px; }
.afoot b { color: var(--text, inherit); }
body.assetpage { padding-bottom: 150px; }
.asum { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--panel); border-top: 1px solid var(--line-2); padding: 8px 16px 10px; display: flex; flex-direction: column; gap: 8px; }
.asum:empty { display: none; }
.asumlist { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--muted); max-height: 64px; overflow-y: auto; }
.asumitem b { color: inherit; font-weight: 600; margin-right: 4px; }
.asumtot { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: rgba(255, 255, 255, .04); }
.asumtitle { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.asumstat { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding-left: 12px; border-left: 1px solid var(--line-2); }
.asumstat small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.asumstat b { font-size: 20px; font-weight: 500; line-height: 1.2; }
.asumstat.all b { font-size: 24px; }
@media (max-width: 700px) { .asum { flex-direction: column; align-items: stretch; } .asumtot { justify-content: space-between; } }
.atitle h1 { margin: 0; font-size: 26px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.atitle .acode { font-size: 20px; padding: 4px 12px; }
.atitle .asub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.bhead .bleft { min-width: 0; flex: 1; }
.btitle { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btitle h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 400; letter-spacing: .02em; }
.bhead .bleft > p { margin: 6px 0 0; }
.bhead { align-items: flex-start; }
.reportbar { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.pbig .ptop { position: sticky; top: -24px; z-index: 4; margin: -24px -28px 18px; padding: 14px 28px; background: var(--panel); border-bottom: 1px solid var(--line-2); border-radius: 12px 12px 0 0; }
.btitle select { width: auto; min-width: 0; padding: 4px 8px; font-size: 13px; }
.pbig .ptop .pbar { max-width: none; }
.asumrow { display: flex; align-items: center; gap: 18px; }
.asumback { display: flex; }
.asumlist { gap: 8px; max-height: 84px; }
.asumitem { display: inline-flex; align-items: center; gap: 8px; padding: 5px 8px 5px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: rgba(255, 255, 255, .03); color: var(--text, inherit); }
.asumitem b { margin: 0; font-weight: 600; }
.asumbox { display: inline-flex; align-items: baseline; gap: 6px; padding: 2px 9px; border: 1px solid var(--line-2); border-radius: 6px; font-size: 14px; }
.asumbox small { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
@media (max-width: 700px) { .asumrow { flex-direction: column; align-items: stretch; } }
.clogo { display: inline-flex; flex: none; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; vertical-align: middle; margin-right: 8px; background: #fff1; border: 1px solid var(--line-2); }
.clogo img { width: 100%; height: 100%; object-fit: cover; }
.btitle .clogo { width: 40px; height: 40px; margin-right: 0; }
.clogo.sm { width: 22px; height: 22px; margin-right: 6px; }
.logocell { white-space: nowrap; } .logocell .clogo { margin-right: 8px; }
.pbig .ptop { margin-bottom: 30px; }
.pbig .bhead { padding-top: 6px; margin-bottom: 26px; }
.btitle { gap: 14px; row-gap: 10px; }
.asum { background: transparent; border-top: 0; padding: 0; gap: 0; pointer-events: none; }
.asum > * { pointer-events: auto; }
.asumback { padding: 0 16px 10px; }
.asumrow { background: var(--panel); border-top: 1px solid var(--line-2); padding: 10px 16px; }
body.assetpage { padding-bottom: 160px; }
.pcard { position: relative; overflow: hidden; }
.pcard > * { position: relative; z-index: 1; }
.pcard > .gear { position: absolute; }
.pcard .cbg { position: absolute; z-index: 0; right: -6px; bottom: -6px; height: 78%; width: auto; max-width: 70%; object-fit: contain; opacity: .13; pointer-events: none; border-radius: 6px; }
.pcard > .gear { z-index: 2; }
main.wide { max-width: none; }
.palette .swatch.custom { margin: 0; }
.pcard .cbg { inset: 0; right: auto; bottom: auto; width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 0; opacity: .07; }
.projsel { display: block; margin-top: 4px; max-width: 220px; font-size: 12px; padding: 3px 6px; color: var(--muted); }
.foleychk { margin-top: 18px; text-transform: none; letter-spacing: 0; font: inherit; color: inherit; }
.foley { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.foley h3 { font-size: 17px; } .num3 { width: 5em; text-align: center; }
.grid2 > .span2 { grid-column: 1 / -1; }
.span2 table { min-width: 0; } .span2 .tag { white-space: nowrap; }
.pcard .stcode.st-todo { background: rgba(120, 120, 130, .18); }
.pcard .stcode.st-doing { background: rgba(214, 168, 79, .2); border-color: rgba(214, 168, 79, .45); }
.pcard .stcode.st-review { background: rgba(74, 163, 223, .22); border-color: rgba(74, 163, 223, .5); }
.pcard .stcode.st-done { background: rgba(111, 191, 143, .2); border-color: rgba(111, 191, 143, .45); }

/* Elenco fatture: colonne a larghezza fissa e contenuto centrato in verticale, per spaziature regolari */
table.inv { table-layout: fixed; min-width: 960px; }
table.inv td, table.inv th { vertical-align: top; padding: 12px 10px; }
table.inv td { line-height: 34px; }
table.inv td .cell-sub { line-height: 1.3; margin-top: 4px; }
table.inv th { vertical-align: bottom; }
table.inv td.tight { width: auto; }
table.inv .c-sel { width: 32px; } table.inv .c-date { width: 92px; } table.inv .c-client { width: 130px; } table.inv .c-proj { width: 120px; }
table.inv .c-amt { width: 92px; } table.inv .c-status { width: 104px; } table.inv .c-center { width: 140px; } table.inv .c-split { width: 92px; } table.inv .c-act { width: 64px; }
table.inv td select, table.inv td input[type="text"] { width: 100%; min-width: 0; }
table.inv th.num, table.inv td.num { padding-right: 18px; }
.clientbox { display: flex; align-items: center; gap: 12px; }
.clientinfo { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.clientinfo .cname { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clientinfo .cell-sub { margin: 0; }
.clientbox .clogo { margin: 0; width: 36px; height: 36px; }
table.inv .projsel { margin: 0; max-width: none; width: 100%; }
table.inv .clientbox { min-height: 34px; } table.inv tr.month td { line-height: 1.3; }
table.inv tr.month td { padding-top: 14px; padding-bottom: 14px; }

/* Asset list «Sample Library»: senza la colonna dell'implementazione */
.aboard.sample .arow { grid-template-columns: 1.3fr 1.5fr 118px 132px 52px 52px 52px 28px; }
.agearwrap { position: relative; display: inline-flex; }
.agearpanel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: 260px; padding: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.agearpanel label { display: block; margin: 0 0 6px; }
.agearpanel p { margin: 8px 0 0; }

/* commento da leggere: puntino rosso sul fumetto */
button.unread { position: relative; }
button.unread::after { content: ''; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: #e5534b; border: 2px solid var(--panel, #111); box-sizing: content-box; }

table.inv td select, table.inv td input[type="text"] { line-height: normal; height: 34px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
table.inv td button { line-height: normal; height: 34px; padding-top: 0; padding-bottom: 0; }
.num2y { width: 110px; }
.ficscope { border: 1px solid var(--line, #2a2a2a); border-radius: 8px; margin: 12px 0; padding: 4px 14px 12px; }
.ficscope .check { margin-top: 10px; }
.fees { display: grid; gap: 4px; width: max-content; margin: 6px 0 0 auto; }
.fee { display: grid; grid-template-columns: 14px auto; gap: 7px; align-items: center; justify-content: start; font-size: 11px; line-height: 1.2; color: var(--muted); white-space: nowrap; cursor: pointer; text-align: left; }
.fee input { width: 14px; height: 14px; margin: 0; }
.pagehead .refresh { display: flex; gap: 12px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
