/* Ore: lo stile dell'app. Un'interfaccia sul modello di Paymo: barra laterale scura, timer in alto, verde come colore d'azione. */
:root {
  --verde: #33c25e; --verde-scuro: #28a64f; --verde-chiaro: #eaf8ef;
  --laterale: #232a31; --laterale-testo: #a9b3bd; --laterale-attivo: #2f3740;
  --sfondo: #f4f5f7; --bordo: #e2e5e9; --bordo-chiaro: #eef0f3; --testo: #23292f; --grigio: #78838e; --rosso: #e5484d;
  --raggio: 5px; --ombra: 0 1px 2px rgba(20, 30, 40, .06);
  --carattere: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font: 14px/1.45 var(--carattere); color: var(--testo); background: var(--sfondo); display: flex; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--verde-scuro); }
h1, h2, h3 { margin: 0; font-weight: 600; }
h3 { font-size: 15px; margin-bottom: 14px; }
small, .tenue { color: var(--grigio); }
.piccolo { font-size: 12px; }
[hidden] { display: none !important; }
.icona { width: 18px; height: 18px; flex: none; }

/* --- barra laterale --- */
.laterale { width: 200px; flex: none; background: var(--laterale); color: var(--laterale-testo); display: flex; flex-direction: column; padding: 18px 0 14px; position: sticky; top: 0; height: 100vh; }
.marchio { font: 700 27px/1 var(--carattere); letter-spacing: -1px; color: #fff; padding: 0 22px 26px; display: inline-flex; align-items: flex-start; }
.marchio i { width: 8px; height: 8px; border-radius: 50%; background: var(--verde); margin: 3px 0 0 2px; }
.marchio.grande { font-size: 44px; color: var(--testo); padding: 0; }
.marchio.grande i { width: 12px; height: 12px; margin-top: 5px; }
.laterale nav, .laterale .piede { display: flex; flex-direction: column; }
.laterale .piede { margin-top: auto; }
.laterale nav a, .laterale .piede a { display: flex; align-items: center; gap: 12px; padding: 10px 22px; color: var(--laterale-testo); border-left: 3px solid transparent; font-weight: 500; }
.laterale nav a:hover, .laterale .piede a:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.laterale nav a.attivo { color: #fff; background: var(--laterale-attivo); border-left-color: var(--verde); }
.laterale .piede a { font-size: 13px; padding: 8px 22px; }

/* --- corpo e barra in alto col timer --- */
.corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.barra { height: 64px; background: #fff; border-bottom: 1px solid var(--bordo); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.barra h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.barra h1 .briciola { color: var(--grigio); font-weight: 500; }
.barra h1 > span { color: #c0c6cc; font-weight: 400; }
.barra h1 small { font-weight: 400; font-size: 13px; }
.contenuto { padding: 22px 24px 60px; max-width: 1280px; width: 100%; }
.avvisi { padding: 14px 24px 0; }
.avviso { padding: 10px 14px; border-radius: var(--raggio); background: var(--verde-chiaro); color: #1d6b38; margin-bottom: 8px; }
.avviso.errore { background: #fdecec; color: #a32d31; }

/* --- il timer --- */
.timer { display: flex; align-items: center; gap: 8px; min-width: 0; }
.timer input.descrizione { width: 230px; }
.timer .scelta-task { width: 310px; }
.timer .in-corso { display: flex; align-items: center; gap: 12px; min-width: 0; }
.timer .tempo-corrente { font: 600 22px/1 var(--carattere); font-variant-numeric: tabular-nums; color: var(--testo); min-width: 96px; text-align: right; }
.timer .cosa { display: flex; flex-direction: column; min-width: 0; max-width: 360px; line-height: 1.25; }
.timer .cosa b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer .cosa small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer .pallino-vivo { width: 10px; height: 10px; border-radius: 50%; background: var(--rosso); animation: pulsa 1.6s infinite; flex: none; }
@keyframes pulsa { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.timer .recenti { display: flex; gap: 6px; flex-wrap: wrap; }
.timer.verticale { flex-direction: column; align-items: stretch; padding: 16px; gap: 10px; background: #fff; border-bottom: 1px solid var(--bordo); }
.timer.verticale input.descrizione, .timer.verticale .scelta-task { width: 100%; }
.timer.verticale .in-corso { flex-direction: column; align-items: stretch; gap: 10px; }
.timer.verticale .tempo-corrente { font-size: 40px; text-align: center; }
.timer.verticale .cosa { max-width: none; text-align: center; }
.timer.verticale .bottone { height: 42px; justify-content: center; font-size: 15px; }

/* --- campi --- */
input[type=text], input[type=email], input[type=search], input[type=password], input[type=date], input[type=time], select, textarea {
  font: inherit; color: inherit; height: 34px; padding: 0 10px; border: 1px solid var(--bordo); border-radius: var(--raggio); background: #fff; width: 100%; outline: none; }
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--verde); box-shadow: 0 0 0 3px rgba(51, 194, 94, .15); }
label { display: block; font-size: 12px; color: var(--grigio); font-weight: 500; margin-bottom: 12px; }
label > input, label > select, label > textarea, label > .scelta-task, label > .colori { margin-top: 4px; }
label.spunta { display: flex; align-items: center; gap: 8px; color: var(--testo); font-size: 14px; font-weight: 400; margin-bottom: 8px; }
label.spunta input { width: 16px; height: 16px; accent-color: var(--verde); margin: 0; }
.due { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tre { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
.quattro { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 6px; }

/* --- bottoni --- */
.bottone { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--bordo); border-radius: var(--raggio); background: #fff; color: var(--testo); font: 500 13px/1 var(--carattere); cursor: pointer; white-space: nowrap; }
.bottone:hover { border-color: #c9cfd5; color: var(--testo); background: #fafbfc; }
.bottone .icona { width: 15px; height: 15px; }
.bottone.primario { background: var(--verde); border-color: var(--verde); color: #fff; }
.bottone.primario:hover { background: var(--verde-scuro); border-color: var(--verde-scuro); }
.bottone.ferma { background: var(--rosso); border-color: var(--rosso); color: #fff; }
.bottone.ferma:hover { background: #c93a3f; }
.bottone.pericolo { color: var(--rosso); }
.bottone.piccolo { height: 28px; padding: 0 9px; font-size: 12px; }
.bottone.fantasma { border-color: transparent; background: transparent; color: var(--grigio); }
.bottone.fantasma:hover { background: #eef0f3; color: var(--testo); }
.bottone.icona-sola { width: 34px; justify-content: center; padding: 0; font-size: 18px; }
.bottone.largo { width: 100%; justify-content: center; height: 40px; font-size: 15px; }
.bottone.chip { height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 500; }
.bottone.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* --- comandi sopra le pagine --- */
.riga-comandi { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.gruppo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gruppo input[type=text], .gruppo input[type=search], .gruppo select { width: auto; min-width: 200px; }
.periodo { font-size: 16px; font-weight: 600; margin-left: 8px; }
.totale-settimana { color: var(--grigio); margin-right: 6px; }
.totale-settimana b { color: var(--testo); font-size: 16px; }
.schede-filtro { display: inline-flex; border: 1px solid var(--bordo); border-radius: var(--raggio); overflow: hidden; background: #fff; }
.schede-filtro a { padding: 0 14px; height: 32px; display: inline-flex; align-items: center; color: var(--grigio); font-weight: 500; font-size: 13px; }
.schede-filtro a + a { border-left: 1px solid var(--bordo); }
.schede-filtro a.attivo { background: var(--verde-chiaro); color: #1d6b38; }

/* --- schede e tabelle --- */
.scheda { background: #fff; border: 1px solid var(--bordo); border-radius: 6px; padding: 20px; box-shadow: var(--ombra); margin-bottom: 18px; }
.titolo-scheda { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.titolo-scheda h3 { margin: 0; }
.due-colonne { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 18px; align-items: start; }
.tabella { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--bordo); border-radius: 6px; box-shadow: var(--ombra); overflow: hidden; }
.tabella th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--grigio); text-align: left; font-weight: 600; padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--bordo); white-space: nowrap; }
.tabella td { padding: 10px 14px; border-bottom: 1px solid var(--bordo-chiaro); vertical-align: middle; }
.tabella tr:last-child td { border-bottom: 0; }
.tabella.semplice { border: 0; box-shadow: none; border-radius: 0; }
.tabella.semplice th { background: transparent; padding-left: 0; }
.tabella.semplice td { padding-left: 0; }
.tabella.cliccabile tbody tr { cursor: pointer; }
.tabella.cliccabile tbody tr:hover td { background: #f8faf9; }
.tabella .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabella .centro { text-align: center; }
.tabella tr.spento td { color: #9aa3ab; }
.tabella .azioni { text-align: right; width: 1%; white-space: nowrap; }
.pallino { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.etichetta { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 3px; background: #eef0f3; color: var(--grigio); }
.etichetta.viva { background: var(--verde-chiaro); color: #1d6b38; }

/* --- la settimana --- */
.settimana { display: flex; flex-direction: column; gap: 10px; }
.giorno { background: #fff; border: 1px solid var(--bordo); border-radius: 6px; box-shadow: var(--ombra); }
.giorno > header { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--bordo-chiaro); }
.giorno.vuoto > header { border-bottom: 0; }
.giorno h2 { font-size: 13px; text-transform: capitalize; }
.giorno h2 span { color: var(--grigio); font-weight: 400; text-transform: none; }
.giorno.oggi { border-color: #bfe9cc; }
.giorno.oggi h2::after { content: "oggi"; margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--verde-scuro); text-transform: uppercase; letter-spacing: .05em; }
.giorno .destra { display: flex; align-items: center; gap: 8px; }
.giorno .totale { font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.giorno.vuoto .totale { color: #b8c0c7; font-weight: 400; }
.voce { display: grid; grid-template-columns: 4px minmax(180px, 1.3fr) 1fr 120px 64px 70px; align-items: center; gap: 14px; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--bordo-chiaro); }
.voce:last-child { border-bottom: 0; }
.voce:hover { background: #fafbfc; }
.voce .colore { align-self: stretch; border-radius: 0 3px 3px 0; }
.voce .cosa { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.voce .cosa b, .voce .cosa small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voce .nota { color: var(--grigio); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voce .orari { color: var(--grigio); font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
.voce .durata { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.voce .azioni { display: flex; justify-content: flex-end; gap: 2px; opacity: .25; }
.voce:hover .azioni { opacity: 1; }
.voce.in-corso { background: #fff8f8; }
.voce.in-corso .durata { color: var(--rosso); }

/* --- finestre --- */
dialog.finestra { border: 0; border-radius: 8px; padding: 0; width: min(560px, 94vw); box-shadow: 0 20px 50px rgba(15, 25, 35, .25); overflow: visible; }
dialog.finestra::backdrop { background: rgba(25, 32, 40, .45); }
dialog.finestra form { padding: 22px; }
.piede-finestra { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.piede-finestra form { margin: 0; }
.spazio { flex: 1; }
.durata-calcolata { margin: -4px 0 12px; font-size: 13px; color: var(--grigio); min-height: 18px; }

/* --- scelta di progetto e task (il menu a tendina con ricerca) --- */
.scelta-task { position: relative; }
.scelta-task input { padding-right: 28px; }
.scelta-task .freccia { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: #a4adb6; pointer-events: none; font-size: 11px; }
.tendina { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--bordo); border-radius: 6px; box-shadow: 0 12px 28px rgba(15, 25, 35, .14); max-height: 340px; overflow-y: auto; padding: 4px 0; min-width: 300px; }
.tendina .titolo-gruppo { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--grigio); padding: 8px 12px 4px; font-weight: 600; }
.tendina .opzione { display: flex; align-items: center; gap: 9px; padding: 7px 12px; cursor: pointer; }
.tendina .opzione .pallino { margin: 0; flex: none; }
.tendina .opzione .testo { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tendina .opzione .testo b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--testo); }
.tendina .opzione .testo small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.tendina .opzione.attiva { background: var(--verde-chiaro); }
.tendina .opzione.nuova b { color: var(--verde-scuro); }
.tendina .vuota { padding: 10px 12px; color: var(--grigio); font-size: 13px; }

/* --- progetto: colori, task --- */
.colori { display: flex; flex-wrap: wrap; gap: 6px; }
.colore-scelta { margin: 0; }
.colore-scelta input { display: none; }
.colore-scelta span { display: block; width: 24px; height: 24px; border-radius: 5px; cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--bordo); }
.colore-scelta input:checked + span { box-shadow: 0 0 0 2px var(--testo); }
.nome-task input { border-color: transparent; background: transparent; padding-left: 4px; margin-left: -5px; height: 30px; }
.nome-task input:hover { border-color: var(--bordo); }
.nome-task input:focus { background: #fff; }
.interruttore { width: 34px; height: 20px; border-radius: 10px; border: 0; background: #d5dade; position: relative; cursor: pointer; vertical-align: middle; }
.interruttore::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.interruttore.acceso { background: var(--verde); }
.interruttore.acceso::after { left: 17px; }
.spunta-tonda { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #c9d0d6; background: #fff; color: transparent; cursor: pointer; font-size: 13px; line-height: 1; }
.spunta-tonda:hover { border-color: var(--verde); color: var(--verde); }
.spunta-tonda.fatta { background: var(--verde); border-color: var(--verde); color: #fff; }

/* --- report: modulo, link per il cliente, anteprima --- */
.modulo-report { max-width: 860px; }
.elenco-progetti { columns: 3 220px; border: 1px solid var(--bordo-chiaro); border-radius: var(--raggio); padding: 10px 12px 2px; margin: -4px 0 14px; max-height: 300px; overflow: auto; background: #fbfcfc; }
.elenco-progetti .spunta { break-inside: avoid; }
.opzioni { margin: 4px 0 6px; }
.link-cliente { display: grid; grid-template-columns: 1fr; gap: 10px; }
.link-cliente h3 { margin: 0 0 2px; }
.link-cliente p { margin: 0; }
.link-riga { display: flex; gap: 8px; align-items: center; }
.link-riga input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--grigio); }
.link-riga.scarica { flex-wrap: wrap; }
.anteprima-report { background: #ececec; border-radius: 6px; padding: 10px 0; overflow-x: auto; }

/* --- accesso, widget --- */
body.pagina-login { align-items: center; justify-content: center; background: var(--laterale); }
.login { background: #fff; border-radius: 10px; padding: 36px 36px 30px; width: min(360px, 92vw); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.login .sotto { color: var(--grigio); margin: 6px 0 22px; }
.login h2 { margin-top: 18px; }
body.pagina-widget { flex-direction: column; background: var(--sfondo); }
.widget-testa { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--laterale); }
.widget-testa .marchio { font-size: 22px; padding: 0; }
.widget-testa .link-app { color: var(--laterale-testo); font-size: 12px; }
.widget-oggi { padding: 14px 16px; }
.widget-oggi header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.widget-oggi h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--grigio); }
.widget-oggi b { font-variant-numeric: tabular-nums; }
.voce-widget { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--bordo); border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; }
.voce-widget:hover { border-color: var(--verde); }
.voce-widget .colore { width: 4px; align-self: stretch; border-radius: 2px; }
.voce-widget .cosa { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.voce-widget .cosa b, .voce-widget .cosa small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voce-widget .durata { font-weight: 600; font-variant-numeric: tabular-nums; }
.widget-suggerimento { font-size: 12px; color: var(--grigio); padding: 0 16px; }

@media (max-width: 1100px) {
  .timer input.descrizione { width: 160px; }
  .timer .scelta-task { width: 230px; }
  .due-colonne { grid-template-columns: 1fr; }
  .voce { grid-template-columns: 4px minmax(140px, 1fr) 0 100px 56px 64px; }
  .voce .nota { display: none; }
}
@media (max-width: 760px) {
  body { flex-direction: column; }
  .laterale { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 8px 10px; }
  .laterale .marchio { padding: 0 12px 0 6px; font-size: 22px; }
  .laterale nav { flex-direction: row; overflow-x: auto; }
  .laterale nav a { padding: 8px 10px; border-left: 0; border-bottom: 3px solid transparent; }
  .laterale nav a span, .laterale .piede { display: none; }
  .barra { height: auto; flex-direction: column; align-items: stretch; padding: 12px; position: static; }
  .timer { flex-wrap: wrap; }
  .timer input.descrizione, .timer .scelta-task { width: 100%; }
  .contenuto { padding: 14px 12px 40px; }
  .voce { grid-template-columns: 4px 1fr 64px 40px; }
  .voce .orari, .voce .nota { display: none; }
  .due, .tre, .quattro { grid-template-columns: 1fr; }
}
