/* Felice Client Portal 14.6.26 - UI cleanup: mobile modal fix, no red, form semplificato, board leggibile */
:root{
  --fcp26-navy:#09244a;
  --fcp26-blue:#155eef;
  --fcp26-blue-2:#33b7ff;
  --fcp26-soft:#f3f8ff;
  --fcp26-line:#d9e7f7;
  --fcp26-text:#0b2444;
  --fcp26-muted:#64748b;
  --fcp26-green:#12b76a;
  --fcp26-shadow:0 16px 40px rgba(15,35,65,.08);
}

/* Palette coerente: niente rosso/viola/rosa nei controlli ordinari */
body.fcp-app-root-page,
body.fcp-app-root-page .fcp-app-shell,
body.fcp-app-root-page .fcp-app-main,
body.fcp-app-root-page .fcp-mobile-native-screen{color:var(--fcp26-text)!important;}
body.fcp-app-root-page .button-link-delete,
body.fcp-app-root-page .danger,
body.fcp-app-root-page [class*="danger"],
body.fcp-app-root-page [style*="#dc"],
body.fcp-app-root-page [style*="red"]{color:var(--fcp26-blue)!important;border-color:#bfdbfe!important;background:#eff6ff!important;}
body.fcp-app-root-page .button,
body.fcp-app-root-page button,
body.fcp-app-root-page input[type="submit"],
body.fcp-app-root-page a.button{
  border-color:#c7d7fe!important;
  color:var(--fcp26-blue)!important;
  background:#fff!important;
  box-shadow:none!important;
}
body.fcp-app-root-page .button-primary,
body.fcp-app-root-page input[type="submit"].button-primary,
body.fcp-app-root-page .fcp-mobile-save-button,
body.fcp-app-root-page .fcp-app-bottom-nav a.is-active,
body.fcp-app-root-page .fcp-mobile-calendar-viewbar button.is-active{
  color:#fff!important;
  background:linear-gradient(135deg,var(--fcp26-blue),var(--fcp26-blue-2))!important;
  border-color:transparent!important;
}
body.fcp-app-root-page .fcp-task-preset,
body.fcp-app-root-page .fcp-due-preset,
body.fcp-app-root-page .fcp-task-preset-remove,
body.fcp-app-root-page .fcp-task-people-tags label{
  color:var(--fcp26-blue)!important;
  border-color:#bfdbfe!important;
  background:#eff6ff!important;
}
body.fcp-app-root-page .fcp-crm-cleanup-card .button-link-delete,
body.fcp-app-root-page .fcp-mobile-task-cleanup .danger{
  color:var(--fcp26-blue)!important;
  border-color:#bfdbfe!important;
  background:#eff6ff!important;
}
body.fcp-app-root-page .fcp-crm-anydo-actions a.button,
body.fcp-app-root-page .fcp-crm-anydo-actions .button,
body.fcp-app-root-page a[href*="complete_task"]{
  color:var(--fcp26-blue)!important;
  background:#eff6ff!important;
  border:1px solid #bfdbfe!important;
}

/* Sync manuale nascosto solo nel frontend: il menu backend resta visibile */
body.fcp-app-root-page [data-fcp-ftc-sync-now]{display:none!important;}

/* Frontend desktop/tablet: usa tutta la pagina, non una colonna stretta */
body.fcp-app-root-page .fcp-app-main{min-width:0!important;max-width:none!important;overflow-x:hidden!important;}
body.fcp-app-root-page .fcp-app-legacy-content,
body.fcp-app-root-page .fcp-app-main .wrap,
body.fcp-app-root-page .fcp-app-admin-wrap{width:100%!important;max-width:none!important;overflow:visible!important;}
body.fcp-app-root-page .fcp-app-topbar{max-width:none!important;}

/* Form Nuova attività: rimuovi visuale vecchia, spazi corretti */
body.fcp-app-root-page .fcp-crm-form-card{
  width:min(1180px,100%)!important;
  max-width:1180px!important;
  margin:18px 0!important;
  padding:26px!important;
  border-radius:24px!important;
  border:1px solid var(--fcp26-line)!important;
  box-shadow:var(--fcp26-shadow)!important;
  background:#fff!important;
}
body.fcp-app-root-page .fcp-crm-form-card h2{font-size:28px!important;line-height:1.1!important;margin:0 0 8px!important;color:var(--fcp26-navy)!important;}
body.fcp-app-root-page .fcp-crm-form-card .description{font-size:15px!important;color:var(--fcp26-muted)!important;margin-bottom:18px!important;}
body.fcp-app-root-page .fcp-crm-form-grid{
  display:grid!important;
  grid-template-columns:minmax(190px,260px) minmax(180px,220px) minmax(180px,220px) minmax(180px,220px)!important;
  gap:16px!important;
  align-items:end!important;
  width:100%!important;
}
body.fcp-app-root-page .fcp-crm-form-grid > input[type="hidden"]{display:none!important;}
body.fcp-app-root-page .fcp-crm-field-wide,
body.fcp-app-root-page .fcp-crm-field-quote{grid-column:1 / -1!important;}
body.fcp-app-root-page .fcp-crm-task-form label{font-size:13px!important;color:var(--fcp26-text)!important;font-weight:900!important;}
body.fcp-app-root-page .fcp-crm-task-form input:not([type="checkbox"]):not([type="radio"]),
body.fcp-app-root-page .fcp-crm-task-form select,
body.fcp-app-root-page .fcp-crm-task-form textarea{
  min-height:48px!important;
  border:1px solid #cfddec!important;
  border-radius:14px!important;
  color:var(--fcp26-text)!important;
  background:#fff!important;
  font-size:15px!important;
  font-weight:650!important;
  padding:10px 14px!important;
}
body.fcp-app-root-page .fcp-task-presets{gap:10px!important;margin-top:12px!important;}
body.fcp-app-root-page .fcp-task-preset{min-height:36px!important;padding:0 12px!important;font-size:13px!important;}
body.fcp-app-root-page .fcp-task-preset-remove{width:32px!important;height:32px!important;font-size:14px!important;}
body.fcp-app-root-page .fcp-task-people-tags{
  padding:16px!important;
  border-radius:18px!important;
  background:#f8fbff!important;
  border:1px solid var(--fcp26-line)!important;
}
body.fcp-app-root-page .fcp-task-people-tags > div{gap:10px!important;}
body.fcp-app-root-page .fcp-task-people-tags label{min-height:36px!important;padding:8px 12px!important;font-size:13px!important;}

/* Kanban/Task operativi: card leggibili, colonne proporzionate */
body.fcp-app-root-page .fcp-crm-anydo-board{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(260px,1fr))!important;
  gap:18px!important;
  width:100%!important;
  align-items:start!important;
  overflow:visible!important;
}
body.fcp-app-root-page .fcp-crm-anydo-column{
  min-width:0!important;
  padding:16px!important;
  border-radius:22px!important;
  background:#f8fbff!important;
  border:1px solid var(--fcp26-line)!important;
}
body.fcp-app-root-page .fcp-crm-anydo-task{
  display:grid!important;
  grid-template-columns:26px minmax(0,1fr)!important;
  gap:12px!important;
  padding:14px!important;
  border-radius:18px!important;
  overflow:hidden!important;
  background:#fff!important;
}
body.fcp-app-root-page .fcp-crm-anydo-main strong,
body.fcp-app-root-page .fcp-mobile-task-card strong{
  overflow:visible!important;
  white-space:normal!important;
  text-overflow:clip!important;
  word-break:normal!important;
  overflow-wrap:anywhere!important;
  line-height:1.22!important;
}
body.fcp-app-root-page .fcp-crm-anydo-main p,
body.fcp-app-root-page .fcp-mobile-task-note-preview{
  overflow:visible!important;
  white-space:normal!important;
  text-overflow:clip!important;
  overflow-wrap:anywhere!important;
}
body.fcp-app-root-page .fcp-fic-pill:empty{display:none!important;}
body.fcp-app-root-page .fcp-crm-anydo-meta{display:flex!important;flex-wrap:wrap!important;gap:8px!important;align-items:center!important;}
body.fcp-app-root-page .fcp-crm-anydo-actions{display:grid!important;gap:10px!important;}
body.fcp-app-root-page .fcp-crm-anydo-actions select{width:100%!important;}
body.fcp-app-root-page .fcp-crm-anydo-actions .button{width:100%!important;text-align:center!important;justify-content:center!important;}

/* Modal CRM desktop */
body.fcp-app-root-page .fcp-crm-modal[aria-hidden="false"],
body.fcp-app-root-page .fcp-crm-modal:not([hidden]){position:fixed!important;inset:0!important;z-index:999999!important;display:grid!important;place-items:center!important;padding:24px!important;}
body.fcp-app-root-page .fcp-crm-modal-backdrop{position:fixed!important;inset:0!important;background:rgba(15,23,42,.48)!important;}
body.fcp-app-root-page .fcp-crm-modal-card{position:relative!important;width:min(920px,calc(100vw - 32px))!important;max-height:calc(100dvh - 40px)!important;overflow:auto!important;border-radius:22px!important;background:#fff!important;box-shadow:0 28px 90px rgba(15,23,42,.28)!important;}
body.fcp-app-root-page .fcp-crm-modal-close,
body.fcp-app-root-page .fcp-mobile-sheet-x{color:var(--fcp26-blue)!important;background:#eff6ff!important;border:1px solid #bfdbfe!important;}

/* Mobile: popup nuova task non deve aprirsi a metà schermo */
@media (max-width: 760px){
  html.fcp-stability-14623 body.fcp-app-root-page.fcp-mobile-task-open,
  body.fcp-app-root-page.fcp-mobile-task-open{overflow:hidden!important;}
  body.fcp-app-root-page .fcp-mobile-sheet-backdrop{
    position:fixed!important;inset:0!important;background:rgba(15,23,42,.50)!important;z-index:999990!important;opacity:0!important;pointer-events:none!important;
  }
  body.fcp-app-root-page.fcp-mobile-task-open .fcp-mobile-sheet-backdrop{opacity:1!important;pointer-events:auto!important;}
  body.fcp-app-root-page .fcp-mobile-task-sheet{
    position:fixed!important;
    left:max(12px,env(safe-area-inset-left))!important;
    right:max(12px,env(safe-area-inset-right))!important;
    top:max(76px,env(safe-area-inset-top))!important;
    bottom:max(16px,env(safe-area-inset-bottom))!important;
    width:auto!important;
    max-width:none!important;
    max-height:none!important;
    transform:none!important;
    opacity:0!important;
    pointer-events:none!important;
    z-index:999999!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch!important;
    padding:24px 18px 28px!important;
    border-radius:26px!important;
    background:#fff!important;
    box-shadow:0 28px 80px rgba(15,23,42,.30)!important;
  }
  body.fcp-app-root-page.fcp-mobile-task-open .fcp-mobile-task-sheet{
    transform:none!important;opacity:1!important;pointer-events:auto!important;
  }
  body.fcp-app-root-page .fcp-mobile-task-sheet h3{font-size:28px!important;margin:0 48px 18px 0!important;line-height:1.08!important;}
  body.fcp-app-root-page .fcp-mobile-task-sheet form{display:grid!important;gap:14px!important;}
  body.fcp-app-root-page .fcp-mobile-task-sheet label{font-size:13px!important;color:#667085!important;font-weight:900!important;text-transform:none!important;letter-spacing:0!important;}
  body.fcp-app-root-page .fcp-mobile-task-sheet input:not([type="checkbox"]):not([type="radio"]),
  body.fcp-app-root-page .fcp-mobile-task-sheet select,
  body.fcp-app-root-page .fcp-mobile-task-sheet textarea{min-height:54px!important;border-radius:18px!important;font-size:16px!important;}
  body.fcp-app-root-page .fcp-mobile-form-grid{grid-template-columns:1fr!important;gap:12px!important;}
  body.fcp-app-root-page .fcp-mobile-date-actions{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:8px!important;}
  body.fcp-app-root-page .fcp-mobile-date-actions button{min-width:0!important;width:100%!important;}
  body.fcp-app-root-page .fcp-mobile-save-button{position:sticky!important;bottom:0!important;min-height:56px!important;border-radius:18px!important;}
  body.fcp-app-root-page .fcp-mobile-native-screen{padding-bottom:calc(120px + env(safe-area-inset-bottom))!important;min-height:auto!important;overflow:visible!important;}
  body.fcp-app-root-page .fcp-app-main{overflow:visible!important;height:auto!important;min-height:100dvh!important;}
  body.fcp-app-root-page .fcp-mobile-task-cleanup{grid-template-columns:1fr 1fr!important;gap:10px!important;}
  body.fcp-app-root-page .fcp-mobile-task-cleanup strong{grid-column:1/-1!important;}
  body.fcp-app-root-page .fcp-mobile-task-cleanup [data-fcp-ftc-sync-now]{display:none!important;}
}

/* Tablet/Desktop modali native più centrate */
@media (min-width: 761px){
  body.fcp-app-root-page .fcp-mobile-task-sheet{
    left:50%!important;top:50%!important;right:auto!important;bottom:auto!important;
    width:min(760px,calc(100vw - 48px))!important;max-height:calc(100dvh - 56px)!important;
    transform:translate(-50%,-50%)!important;overflow:auto!important;
  }
  body.fcp-app-root-page.fcp-mobile-task-open .fcp-mobile-task-sheet{transform:translate(-50%,-50%)!important;opacity:1!important;pointer-events:auto!important;}
  body.fcp-app-root-page .fcp-mobile-sheet-backdrop{position:fixed!important;inset:0!important;z-index:999990!important;background:rgba(15,23,42,.48)!important;}
}

@media (max-width: 1180px){
  body.fcp-app-root-page .fcp-crm-anydo-board{grid-template-columns:repeat(2,minmax(260px,1fr))!important;}
  body.fcp-app-root-page .fcp-crm-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media (max-width: 760px){
  body.fcp-app-root-page .fcp-crm-anydo-board{grid-template-columns:1fr!important;}
  body.fcp-app-root-page .fcp-crm-form-grid{grid-template-columns:1fr!important;}
  body.fcp-app-root-page .fcp-crm-form-card{padding:18px!important;border-radius:22px!important;}
}
