/* FARMO Organizer V13 - Assenze, Report e Task liberi */
:root{
  --fo-sickness:#b91c1c;
  --fo-sickness-soft:#fef2f2;
  --fo-permit:#7c3aed;
  --fo-permit-soft:#f5f3ff;
  --fo-vacation:#be185d;
}

/* Assenze */
.fo-leaves-toolbar{grid-template-columns:minmax(0,1fr) 180px 160px!important}
.fo-leave-status{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.fo-absence-badge{display:inline-flex;align-items:center;min-height:24px;padding:0 8px;border-radius:999px;font-size:10px;font-weight:950;letter-spacing:.04em;text-transform:uppercase;background:#eef2ff;color:#061b49}
.fo-absence-malattia{border-left:4px solid var(--fo-sickness)!important}
.fo-absence-malattia .fo-absence-badge{background:var(--fo-sickness-soft);color:var(--fo-sickness)}
.fo-absence-permesso{border-left:4px solid var(--fo-permit)!important}
.fo-absence-permesso .fo-absence-badge{background:var(--fo-permit-soft);color:var(--fo-permit)}
.fo-absence-ferie{border-left:4px solid var(--fo-vacation)!important}
.fo-absence-ferie .fo-absence-badge{background:#fdf2f8;color:var(--fo-vacation)}
.fo-absence-time{display:inline-flex;padding:3px 8px;border-radius:999px;background:#ede9fe;color:#5b21b6;font-size:10px;font-weight:950}
.calendar-ticket.leave-ticket.absence-malattia{background:var(--fo-sickness)!important}
.calendar-ticket.leave-ticket.absence-permesso{background:var(--fo-permit)!important}
.calendar-ticket.leave-ticket.absence-ferie{background:var(--fo-vacation)!important}
.planning-leave.absence-malattia{background:var(--fo-sickness)!important;border-color:#fecaca!important}
.planning-leave.absence-permesso{background:var(--fo-permit)!important;border-color:#ddd6fe!important}
.planning-leave.absence-ferie{background:var(--fo-vacation)!important}

/* Panoramica: tre tipi di assenza distinti */
:root{--fo-overview-sickness:var(--fo-sickness);--fo-overview-permit:var(--fo-permit)}
.fo-overview-chip[data-type="sickness"]::before{background:var(--fo-overview-sickness)}
.fo-overview-chip[data-type="permit"]::before{background:var(--fo-overview-permit)}
.fo-overview-event-pill[data-type="sickness"]{background:var(--fo-overview-sickness)}
.fo-overview-event-pill[data-type="permit"]{background:var(--fo-overview-permit)}
.fo-overview-agenda-card[data-type="sickness"] .fo-overview-agenda-accent{background:var(--fo-overview-sickness)}
.fo-overview-agenda-card[data-type="permit"] .fo-overview-agenda-accent{background:var(--fo-overview-permit)}
.fo-overview-mobile-legend span i.fo-sickness-legend{background:var(--fo-overview-sickness)}
.fo-overview-mobile-legend span i.fo-permit-legend{background:var(--fo-overview-permit)}

/* Report */
.fo-report-filter-card{padding:14px;border:1px solid #dbe3ee;border-radius:16px;background:#f8fafc;margin-bottom:14px}
.fo-report-filter-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.fo-report-filter-grid label{display:grid;gap:6px;color:#061b49;font-size:12px;font-weight:900}
.fo-report-filter-grid :where(input,select){width:100%;min-height:44px;margin:0}
.fo-report-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:12px}
.fo-report-actions button{min-height:44px;margin:0}
.fo-report-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0}
.fo-report-kpi{padding:13px 14px;border:1px solid #dbe3ee;border-radius:14px;background:#fff}
.fo-report-kpi span{display:block;color:#64748b;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.05em}
.fo-report-kpi strong{display:block;margin-top:5px;color:#061b49;font-size:18px;font-weight:950;line-height:1.2}
.fo-report-content{display:grid;gap:14px}
.fo-report-block{border:1px solid #dbe3ee;border-radius:16px;background:#fff;overflow:hidden}
.fo-report-title{padding:12px 14px;background:#f4f7fb;color:#061b49;font-weight:950;border-bottom:1px solid #dbe3ee}
.fo-report-table-wrap{overflow:auto;max-width:100%}
.fo-report-table{width:100%;min-width:720px;border-collapse:collapse}
.fo-report-detail{min-width:1080px}
.fo-report-table th,.fo-report-table td{padding:10px 11px;border-bottom:1px solid #e7edf5;text-align:left;vertical-align:top;font-size:12px}
.fo-report-table th{position:sticky;top:0;background:#061b49;color:#fff;font-size:10px;text-transform:uppercase;letter-spacing:.04em;z-index:1}
.fo-report-free-task{display:inline-flex;margin-left:6px;padding:2px 6px;border-radius:999px;background:#eef2ff;color:#4338ca;font-size:9px;font-weight:900;text-transform:uppercase}

/* Task dipendente: assegnati + altri task liberi */
.fo-task-personal-section,.fo-task-other-section{display:grid;gap:10px;margin-top:14px}
.fo-task-other-section{padding-top:14px;border-top:1px solid #dbe3ee}
.fo-task-section-title{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap;color:#061b49}
.fo-task-section-title span{font-size:16px;font-weight:950}
.fo-task-section-title small{color:#64748b;font-size:11px;font-weight:800}
.fo-task-other-search input{width:100%;min-height:44px;margin:0}
.fo-task-other-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.fo-task-other-grid .task-card{min-width:0}

body.dark-mode .fo-report-filter-card,
body.dark-mode .fo-report-kpi,
body.dark-mode .fo-report-block{background:#111c33;border-color:#33415c}
body.dark-mode .fo-report-title{background:#17233c;border-color:#33415c;color:#e7eefc}
body.dark-mode .fo-report-kpi strong,
body.dark-mode .fo-report-filter-grid label,
body.dark-mode .fo-task-section-title{color:#e7eefc}
body.dark-mode .fo-report-table td{border-color:#33415c;color:#dce5f4}

@media(max-width:900px){
  .fo-report-filter-grid{grid-template-columns:1fr 1fr}
  .fo-report-summary{grid-template-columns:1fr 1fr}
  .fo-task-other-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:700px){
  .fo-leaves-toolbar{grid-template-columns:1fr!important}
  .fo-report-filter-card{padding:12px;border-radius:12px}
  .fo-report-filter-grid{grid-template-columns:1fr}
  .fo-report-actions{display:grid;grid-template-columns:1fr 1fr}
  .fo-report-actions button{width:100%}
  .fo-report-summary{grid-template-columns:1fr 1fr;gap:8px}
  .fo-report-kpi{padding:11px;border-radius:11px}
  .fo-report-kpi strong{font-size:15px}
  .fo-report-table-wrap{margin:0;overscroll-behavior-inline:contain}
  .fo-task-other-grid{grid-template-columns:1fr}
  .fo-task-section-title{align-items:flex-start;flex-direction:column;gap:2px}
}

.fo-leaves-summary{grid-template-columns:repeat(4,minmax(0,1fr))!important}
@media(max-width:700px){
  .fo-leaves-summary{grid-template-columns:1fr 1fr!important}
  .fo-leave-kpi:last-child{grid-column:auto!important}
}


/* V13.1 - Consuntivazione ore semplice */
#activityBoardPage .activity-form-box{display:none!important}
#activityBoardPage .activity-board{display:block!important}
.fo-simple-hours-form{display:grid!important;grid-template-columns:1fr 1fr;gap:12px!important}
.fo-simple-hours-form>div{min-width:0}
.fo-simple-hours-form .task-hours-note,.fo-simple-hours-form .task-hours-info,.fo-simple-hours-form .task-hours-actions{grid-column:1/-1}
.fo-simple-hours-form label{display:grid;gap:6px;font-weight:900;color:#061b49}
.fo-simple-hours-form :where(input,select){width:100%;min-height:46px;margin:0}
.fo-simple-hours-form .task-hours-info{padding:10px 12px;border-radius:12px;background:#f4f7fb;color:#526079;font-size:12px;font-weight:800}
.fo-hours-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid #dbe3ee;border-radius:14px;background:#f8fafc;margin-bottom:12px}
.fo-hours-toolbar>div{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}.fo-hours-toolbar span{font-weight:950;color:#061b49}.fo-hours-toolbar strong{font-size:18px;color:#061b49}
.fo-hours-entry-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.fo-hours-entry-card{min-width:0;padding:13px;border:1px solid #dbe3ee;border-radius:14px;background:#fff}
.fo-hours-entry-main{display:flex;align-items:center;justify-content:space-between;gap:10px}.fo-hours-entry-main strong{color:#061b49;font-size:17px}.fo-hours-entry-date{font-weight:900;color:#526079}
.fo-hours-entry-ref{display:flex;flex-direction:column;gap:4px;margin-top:9px;font-size:12px;color:#64748b}.fo-hours-entry-ref b{color:#061b49}.fo-hours-entry-title{margin-top:9px;padding-top:9px;border-top:1px solid #e7edf5;font-weight:800;color:#334155}
body.dark-mode .fo-simple-hours-form label,body.dark-mode .fo-hours-toolbar span,body.dark-mode .fo-hours-toolbar strong,body.dark-mode .fo-hours-entry-main strong,body.dark-mode .fo-hours-entry-ref b{color:#e7eefc}
body.dark-mode .fo-simple-hours-form .task-hours-info,body.dark-mode .fo-hours-toolbar,body.dark-mode .fo-hours-entry-card{background:#111c33;border-color:#33415c;color:#dce5f4}
@media(max-width:900px){.fo-hours-entry-list{grid-template-columns:1fr 1fr}}
@media(max-width:700px){.fo-simple-hours-form{grid-template-columns:1fr}.fo-simple-hours-form>*{grid-column:1!important}.fo-hours-toolbar{align-items:stretch;flex-direction:column}.fo-hours-toolbar .task-hours-global-btn{width:100%;min-height:46px}.fo-hours-entry-list{grid-template-columns:1fr}.fo-hours-entry-card{border-radius:12px}}


/* V13.3 - Matrice ore Dipendenti x Macchine/Commesse */
.fo-report-matrix-help{padding:10px 14px;background:#fff;color:#64748b;font-size:11px;font-weight:800;border-bottom:1px solid #e7edf5}
.fo-report-matrix{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0}
.fo-report-matrix th,.fo-report-matrix td{white-space:nowrap;text-align:center;min-width:105px}
.fo-report-matrix th:first-child,.fo-report-matrix td:first-child{position:sticky;left:0;z-index:3;text-align:left;min-width:190px;max-width:240px}
.fo-report-matrix thead th:first-child{z-index:5;background:#061b49}
.fo-report-matrix tbody td:first-child,.fo-report-matrix tfoot td:first-child{background:#fff;border-right:2px solid #dbe3ee}
.fo-report-matrix tfoot td{position:sticky;bottom:0;background:#f4f7fb;color:#061b49;font-weight:950;border-top:2px solid #cbd5e1}
.fo-report-matrix tfoot td:first-child{z-index:4;background:#f4f7fb}
.fo-report-matrix .fo-matrix-person strong{display:block;color:#061b49}
.fo-report-matrix .fo-matrix-person small{display:block;margin-top:2px;color:#64748b;font-size:9px;white-space:normal}
.fo-report-matrix .fo-matrix-hours{font-variant-numeric:tabular-nums}
.fo-report-matrix .fo-matrix-total{background:#f8fafc;color:#061b49}
body.dark-mode .fo-report-matrix-help{background:#111c33;color:#a8b5ca;border-color:#33415c}
body.dark-mode .fo-report-matrix tbody td:first-child,body.dark-mode .fo-report-matrix tfoot td:first-child{background:#111c33;border-color:#33415c}
body.dark-mode .fo-report-matrix tfoot td,body.dark-mode .fo-report-matrix .fo-matrix-total{background:#17233c;color:#e7eefc}
body.dark-mode .fo-report-matrix .fo-matrix-person strong{color:#e7eefc}
@media(max-width:700px){.fo-report-matrix th:first-child,.fo-report-matrix td:first-child{min-width:150px;max-width:180px}.fo-report-matrix th,.fo-report-matrix td{min-width:92px;padding:9px 8px}}
