/* =========================================================
   XLLAB Studio — integrazioni al foglio di stile condiviso
   (../gestionale/app.css)
   ========================================================= */
.menu a em { font-style: normal; }
.mini { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.cod { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .01em; }
.num-b { font-family: var(--f-d); font-size: 16px; white-space: nowrap; flex: none; }
.clic { cursor: pointer; }
.list li.clic:hover { background: rgba(201,162,39,.06); }
.desc { margin: 0 0 16px; padding: 12px 14px; background: var(--paper); border-radius: 10px; font-size: 14px; }
.sotto { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -10px 0 16px; color: var(--muted); font-size: 14px; }
.lbl { margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sel-l { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sel { border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; background: var(--white); font-size: 13px; cursor: pointer; max-width: 100%; }
.sel:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.18); }

/* Iniziali dei professionisti */
.resp { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.resp .ini { width: 28px; height: 28px; font-size: 10.5px; }
.ini.pr2 { background: var(--gold); color: var(--ink); }
.ini.pr3 { background: var(--info); color: #fff; }
.ini.soc { border-radius: 9px; }

/* Urgenza delle scadenze */
.u-list li { position: relative; padding-left: 12px; }
.u-list li::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--line); }
.u-list li.u-scaduta::before { background: var(--ko); }
.u-list li.u-oggi::before { background: var(--gold); }
.u-list li.u-3::before { background: var(--warn); }
.u-list li.u-7::before { background: var(--info); }
.u-list li.u-fatta { opacity: .6; }
.u-list li.u-fatta .t b { text-decoration: line-through; }
.u-list li.u-scaduta .date-chip { background: rgba(179,65,47,.1); color: var(--ko); }
.u-list li[data-scad] { cursor: pointer; }
.u-list .acts { flex: none; align-items: center; }
.u-legend span::before { background: var(--line); }
.u-legend .l-scaduta::before { background: var(--ko); }
.u-legend .l-oggi::before { background: var(--gold); }
.u-legend .l-3::before { background: var(--warn); }
.u-legend .l-7::before { background: var(--info); }

/* Registro attività */
.feed li { justify-content: flex-start; align-items: flex-start; gap: 12px; }
.feed .dot { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); color: var(--gold-3); font-size: 14px; }
.feed .t b { white-space: normal; font-weight: 500; }
.list .bar { display: block; margin: 7px 0 0; }

/* Schede nella finestra */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 9px 12px; cursor: pointer; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--gold); font-weight: 600; }
.tabs button span { font-size: 11px; background: var(--paper); border-radius: 99px; padding: 1px 7px; margin-left: 6px; }
.tabs button.on span { background: var(--gold); color: var(--ink); }
.tab-c { min-height: 180px; }
.tab-c .tbl-wrap table { min-width: 560px; }
.form-f.foot { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; }
.mini-sum { margin: 0 0 4px; }
.mini-sum .card { padding: 14px 16px; background: var(--paper); border: 0; }
.mini-sum .card b { font-size: 20px; }
.diario p { margin: 2px 0 0; font-size: 14px; white-space: pre-line; }
.diario li { align-items: flex-start; }
.diario .t small { display: block; }
.doc-up { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; }
.doc-up .form-f { grid-column: auto; margin-top: 0; }

/* Icone dei documenti */
.fi { flex: none; position: relative; width: 34px; height: 42px; border-radius: 5px; display: grid; place-items: end center; padding-bottom: 6px; font-size: 9px; font-weight: 700; letter-spacing: .04em; color: #fff; background: var(--muted); }
.fi::before { content: ""; position: absolute; right: 0; top: 0; width: 11px; height: 11px; background: linear-gradient(225deg, var(--white) 50%, rgba(255,255,255,.4) 50%); border-bottom-left-radius: 3px; }
.fi.f-pdf { background: var(--ko); }
.fi.f-doc { background: var(--info); }
.fi.f-xls { background: var(--ok); }
.fi.f-img { background: var(--gold-3); }
.fi.f-dwg { background: #5b4b8a; }

/* Agenda delle scadenze */
.ag-day { margin-bottom: 18px; }
.ag-day > h3 { font-family: var(--f-b); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ag-day > h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.ag-day.scad > h3 { color: var(--ko); }
.ag-day.oggi > h3 { color: var(--gold-3); }
.ag-it { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; transition: box-shadow .2s; }
.ag-it:hover { box-shadow: 0 10px 22px rgba(0,0,0,.07); }
.ag-it.udienza { border-left-color: var(--info); }
.ag-it.termine { border-left-color: var(--warn); }
.ag-it.fiscale { border-left-color: var(--ok); }
.ag-it.appuntamento { border-left-color: var(--muted); }
.ag-it.late { border-left-color: var(--ko); background: rgba(179,65,47,.05); border-color: rgba(179,65,47,.25); border-left-color: var(--ko); }
.ag-it.fatta { opacity: .6; }
.ag-it.fatta .t b { text-decoration: line-through; }
.ag-ora { font-family: var(--f-d); font-weight: 800; font-size: 16px; line-height: 1.15; }
.ag-ora small { display: block; font-family: var(--f-b); font-weight: 500; font-size: 11px; color: var(--muted); }
.ag-it .t { min-width: 0; }
.ag-it .t b { display: block; font-weight: 600; }
.ag-it .t small { color: var(--muted); font-size: 13px; }
.ag-it .acts { align-items: center; }

/* Calendario per tipo */
.ev.udienza { border-color: var(--info); background: rgba(61,90,128,.1); }
.ev.termine { border-color: var(--warn); background: rgba(183,121,31,.12); }
.ev.fiscale { border-color: var(--ok); background: rgba(47,125,79,.1); }
.ev.appuntamento { border-color: var(--muted); background: rgba(0,0,0,.05); }
.ev.late { border-color: var(--ko); background: rgba(179,65,47,.12); color: var(--ko); font-weight: 600; }
.ev.fatta { opacity: .5; text-decoration: line-through; }
.s-legend .l-udienza::before { background: var(--info); }
.s-legend .l-termine::before { background: var(--warn); }
.s-legend .l-fiscale::before { background: var(--ok); }
.s-legend .l-appuntamento::before { background: var(--muted); }
.s-legend .l-late::before { background: var(--ko); }

/* Cronometro */
.cron { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cron-l { display: flex; flex-direction: column; flex: none; }
.cron-l .mini { margin: 0; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 600; }
.cron-t { font-family: var(--f-d); font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cron.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.cron.on .cron-t { color: var(--gold); }
.cron.on .cron-l .mini, .cron.on .cron-info small { color: rgba(255,255,255,.6); }
.cron.on .b { color: var(--text); }
.cron.on .b-gold { color: var(--ink); }
.cron .form { flex: 1; min-width: 0; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; align-items: end; }
.cron .form .form-f { grid-column: auto; margin-top: 0; }
.cron-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cron-info b { font-weight: 600; }
.cron-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--gold); background: rgba(201,162,39,.14); border-radius: 99px; padding: 8px 13px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; }
.cron-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ko); animation: lampeggia 1.2s infinite; }
.cron-pill[hidden] { display: none; }
@keyframes lampeggia { 50% { opacity: .2; } }

/* Timesheet settimanale */
.ts th, .ts td { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ts th:first-child, .ts td:first-child { text-align: left; white-space: normal; min-width: 220px; }
.ts td.z { color: rgba(0,0,0,.2); }
.ts .wk { background: rgba(0,0,0,.025); }
.ts .today { background: rgba(201,162,39,.12); }
.ts thead th.today { color: var(--gold-3); }
.ts tfoot th { border-bottom: 0; border-top: 2px solid var(--ink); color: var(--text); font-size: 13px; }
.ts td .link { font-size: 14px; }

/* Modulo parcella */
.form label.chk { flex-direction: row; align-items: center; gap: 9px; color: var(--text); font-size: 14px; }
.form label.chk input { width: 18px; height: 18px; accent-color: var(--gold-3); padding: 0; }
.ore-sel { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; }
.form .ore-sel label { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--text); font-weight: 400; cursor: pointer; }
.form .ore-sel label:first-child { border-top: 0; }
.ore-sel input { width: 16px; height: 16px; accent-color: var(--gold-3); }
.ore-sel b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ore-sel small { color: var(--muted); font-size: 12px; }
.ore-sel em { font-style: normal; font-size: 13px; font-weight: 600; white-space: nowrap; }
.riga.sp { grid-template-columns: minmax(0, 1fr) 120px 34px; }
.calc { grid-column: 1 / -1; background: var(--paper); border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.calc div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.calc .m { color: var(--ko); }
.calc .g { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; font-family: var(--f-d); font-weight: 800; font-size: 18px; }

/* Documento parcella */
.doc .tot-doc { width: min(340px, 100%); }
.doc .tot-doc .sep { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; font-weight: 600; }
.doc-logo small + small { margin-top: 2px; }
.doc .att { margin: 0 0 14px; font-size: 13px; }
.doc .att p { margin: 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.doc .att table { margin: 8px 0 0; }
.doc .att td { padding: 6px 8px; font-size: 12.5px; }
.nuovo-g { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .cron .form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cron .form .form-f { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .menu a em { display: none; }
  .top-act { flex-wrap: wrap; }
  .ag-it { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px; }
  .ag-ora { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
  .ag-ora small { display: inline; }
  .ag-it .acts { justify-content: flex-start; }
  .cron { gap: 12px; }
  .cron .form, .doc-up { grid-template-columns: minmax(0, 1fr); }
  .cron .form .form-f, .doc-up .form-f { grid-column: 1 / -1; }
  .u-list li { flex-wrap: wrap; }
  .u-list .acts { justify-content: flex-start; padding-left: 58px; }
  .nuovo-g { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ts th:first-child, .ts td:first-child { min-width: 170px; }
  .riga.sp { grid-template-columns: minmax(0, 1fr) 90px 30px; }
  .modal-box { padding: 20px 16px; }
  .toolbar > .acts { justify-content: flex-start; }
}
.u-list li { flex-wrap: wrap; }
.u-list li > .row-l { flex: 1 1 280px; }
.u-list .t b { white-space: normal; }
.cron .form { flex: 1 1 560px; }
.doc .tbl-wrap table { min-width: 0; }
@media (max-width: 820px) {
  .cron { flex-direction: column; align-items: stretch; }
  .cron .form { flex: none; width: 100%; }
  .doc-h { flex-wrap: wrap; }
  .doc-n { text-align: left; }
  .doc-logo { font-size: 17px; }
  .doc .tbl-wrap table { min-width: 420px; }
  .doc th, .doc td { padding: 8px 6px; font-size: 13px; }
  .ts { font-size: 13px; }
}
em.tag, em.resp, .resp i { font-style: normal; }
.resp i.ini { width: 28px; height: 28px; font-size: 10.5px; }
@media print {
  .app, .demo-bar, .toast, .modal-x, .modal .form-f, .modal h2 { display: none !important; }
  .modal { position: static; display: block; background: none; backdrop-filter: none; padding: 0; animation: none; }
  .modal-box { position: static; width: 100% !important; max-height: none; overflow: visible; box-shadow: none; padding: 0; animation: none; }
  .doc { position: static !important; }
  .doc .tbl-wrap { overflow: visible; }
}
.brand span { white-space: nowrap; }
.doc .tot-doc div { gap: 14px; }
.doc .tot-doc .g { font-size: 17px; }

/* v6: schede della pratica tutte visibili (vanno a capo), nota scadute */
.tabs { flex-wrap: wrap; overflow: visible; row-gap: 0; }
.scad-nota { margin: -6px 0 8px; font-size: 13px; }
.scad-nota .link { color: var(--ko); text-decoration-color: rgba(179,65,47,.4); font-weight: 600; }
@media (max-width: 820px) {
  .tabs button { padding: 8px 9px; }
  .tabs button span { margin-left: 4px; }
}
