* {
  box-sizing: border-box;
}

:root {
  --crm-bg: #e7edf3;
  --crm-surface: #ffffff;
  --crm-surface-soft: #f3f6f9;
  --crm-text: #121b2b;
  --crm-muted: #4e6077;
  --crm-line: #bec9d6;
  --crm-primary: #2563eb;
  --crm-primary-dark: #1748bd;
  --crm-primary-soft: #dfe9fb;
  --crm-accent: #0f766e;
  --crm-accent-soft: #dcf8f2;
  --crm-warning: #f59e0b;
  --crm-danger: #dc2626;
  --crm-shadow: 0 10px 26px rgba(23, 32, 51, 0.11);
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--crm-bg);
  color: var(--crm-text);
  font-family: Inter, Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body:not(.crm-top):not(.crm-login) {
  padding: 16px;
}

body.crm-home-page {
  padding: 18px;
}

a {
  color: var(--crm-primary-dark);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  color: var(--crm-primary);
  text-decoration: underline;
}

.crm-page a,
.crm-home-page a,
.crm-module-body a,
.crm-archive a,
.crm-popup a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid var(--crm-line);
  border-radius: 6px;
  background: var(--crm-surface-soft);
  color: var(--crm-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  padding: 6px 9px;
  text-decoration: none;
  vertical-align: middle;
}

.crm-page a:hover,
.crm-home-page a:hover,
.crm-module-body a:hover,
.crm-archive a:hover,
.crm-popup a:hover {
  border-color: var(--crm-primary);
  background: var(--crm-primary-soft);
  color: var(--crm-primary-dark);
  text-decoration: none;
}

.crm-page a[href*="javascript:history.back"],
.crm-home-page a[href*="javascript:history.back"] {
  background: #eef2f7;
  color: #475569;
}

.crm-page a[href*="inserisci"],
.crm-page a[href*="ins.php"],
.crm-page a[href*="eshop.php"],
.crm-page a[href*="nuovo"],
.crm-page a[href*="new.php"],
.crm-page a[href*="scrivi"],
.crm-module-body a[href*="inserisci"],
.crm-module-body a[href*="ins.php"],
.crm-module-body a[href*="nuovo"],
.crm-module-body a[href*="new.php"] {
  border-color: transparent;
  background: var(--crm-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 118, 110, .2);
}

.crm-page a[href*="inserisci"]:hover,
.crm-page a[href*="ins.php"]:hover,
.crm-page a[href*="eshop.php"]:hover,
.crm-page a[href*="nuovo"]:hover,
.crm-page a[href*="new.php"]:hover,
.crm-page a[href*="scrivi"]:hover,
.crm-module-body a[href*="inserisci"]:hover,
.crm-module-body a[href*="ins.php"]:hover,
.crm-module-body a[href*="nuovo"]:hover,
.crm-module-body a[href*="new.php"]:hover {
  background: var(--crm-primary-dark);
  color: #fff;
}

.crm-page a[href*="cancella"],
.crm-module-body a[href*="cancella"],
.crm-archive a[href*="cancella"] {
  border-color: transparent;
  background: #fee2e2;
  color: #991b1b;
}

.crm-page a[href*="cancella"]:hover,
.crm-module-body a[href*="cancella"]:hover,
.crm-archive a[href*="cancella"]:hover {
  background: #fecaca;
  color: #7f1d1d;
}

.crm-page a[href^="mailto:"],
.crm-popup a[href^="mailto:"] {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

center {
  display: block;
  width: 100%;
}

font {
  font-family: inherit;
}

font[size="+1"],
font[size="+2"],
font[size="+3"] {
  color: var(--crm-text);
  font-weight: 800;
  letter-spacing: 0;
}

input,
select,
textarea {
  border: 1px solid var(--crm-line);
  border-radius: 6px;
  background: #fff;
  color: var(--crm-text);
  font: inherit;
  padding: 7px 9px;
}

input[size="100"] {
  width: min(720px, 100%);
}

input[size="80"] {
  width: min(620px, 100%);
}

input[size="60"] {
  width: min(520px, 100%);
}

input[size="50"] {
  width: min(460px, 100%);
}

textarea {
  min-height: 110px;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  margin-right: 5px;
  accent-color: var(--crm-primary);
}

input[type="submit"],
input[type="button"],
button {
  border: 0;
  border-radius: 6px;
  background: var(--crm-primary);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 8px 14px;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.22);
}

input[type="submit"],
input[type="button"] {
  min-height: 34px;
  text-transform: uppercase;
}

input[value="Cerca"],
input[value="AGGIORNA"],
input[value="STAMPA"],
input[value="Modifica"],
input[value="Salva"],
input[value="SCRIVI"],
input[value="APPLICA MODIFICHE"],
input[value="MODIFICA"] {
  border: 0;
  background: var(--crm-primary);
  color: #fff;
}

input[value="Cerca"]:hover,
input[value="AGGIORNA"]:hover,
input[value="STAMPA"]:hover,
input[value="Modifica"]:hover,
input[value="Salva"]:hover,
input[value="SCRIVI"]:hover,
input[value="APPLICA MODIFICHE"]:hover,
input[value="MODIFICA"]:hover {
  background: var(--crm-primary-dark);
}

input[type="submit"]:hover,
input[type="button"]:hover,
button:hover {
  background: var(--crm-primary-dark);
}

hr {
  border: 0;
  border-top: 1px solid var(--crm-line);
}

fieldset {
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: var(--crm-surface);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  padding: 12px 14px 14px;
}

table {
  max-width: 100%;
}

td,
th {
  vertical-align: middle;
}

table[bgcolor],
td[bgcolor],
tr[bgcolor] {
  background-color: var(--crm-surface) !important;
}

table[bgcolor="orange"],
td[bgcolor="orange"],
tr[bgcolor="orange"],
table[bgcolor="yellow"],
td[bgcolor="yellow"],
tr[bgcolor="yellow"],
table[bgcolor="lightblue"],
td[bgcolor="lightblue"],
tr[bgcolor="lightblue"],
table[bgcolor="lightgreen"],
td[bgcolor="lightgreen"],
tr[bgcolor="lightgreen"] {
  background-color: var(--crm-primary-soft) !important;
}

tr[bgcolor="red"],
td[bgcolor="red"] {
  background-color: #fee2e2 !important;
  color: #7f1d1d;
}

table[border="1"] {
  border: 1px solid var(--crm-line) !important;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

table[border="1"] td,
table[border="1"] th {
  border: 0 !important;
  border-bottom: 1px solid #e7ebf1 !important;
  padding: 8px 10px;
}

table[border="1"] tr:last-child td {
  border-bottom: 0 !important;
}

table[border="1"] tr:first-child td,
table[border="1"] tr:first-child th {
  background: #eef6f5 !important;
  color: var(--crm-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

table[border="1"] tr:not(:first-child):hover td {
  background: #fafcfd !important;
}

table[border="1"] a {
  min-height: 24px;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 11px;
  white-space: normal;
}

table[border="1"] tr:first-child a {
  min-height: auto;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #344256;
  font-size: 11px;
  font-weight: 900;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

table[border="1"] tr:first-child a:hover {
  background: transparent;
  color: var(--crm-primary-dark);
}

table[border="1"] tr:not(:first-child) a {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #1f2a3d;
}

table[border="1"] tr:not(:first-child) a[href*="visualizza"],
table[border="1"] tr:not(:first-child) a[href*="vedi.php"] {
  border-color: #b8cdfd;
  background: var(--crm-primary-soft);
  color: var(--crm-primary-dark);
}

table[border="1"] tr:not(:first-child) a[href*="popup.php"],
table[border="1"] tr:not(:first-child) a[href^="javascript:poppa"] {
  border-color: #d7dee9;
  background: #ffffff;
  color: #334155;
}

table[border="1"] tr:not(:first-child) a:hover {
  border-color: var(--crm-primary);
  background: #e8f0ff;
  color: var(--crm-primary-dark);
}

form table[bgcolor],
table[bgcolor="#c6c6c6"],
table[bgcolor="#e6e6e6"],
table[bgcolor="#ccccff"],
table[bgcolor="#cccccc"] {
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: var(--crm-surface) !important;
  box-shadow: var(--crm-shadow);
}

form table[bgcolor="#c6c6c6"],
form table[bgcolor="#e6e6e6"] {
  width: auto;
  max-width: 100%;
  margin: 12px auto;
}

form table[bgcolor="#c6c6c6"] td:first-child,
form table[bgcolor="#e6e6e6"] td:first-child {
  color: var(--crm-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
}

form + table,
table + form,
form table + input[type="submit"] {
  margin-top: 10px;
}

.crm-page form input[type="submit"] + input[type="submit"],
.crm-page form input[type="submit"] + input[type="button"],
.crm-page form input[type="button"] + input[type="button"] {
  margin-left: 8px;
}

.crm-page form[action*="cancella"] input[type="submit"],
input[value="Cancella"],
input[value*="CANCELLA"],
input[name="conferma"] {
  background: #b91c1c;
  box-shadow: 0 2px 6px rgba(185, 28, 28, .2);
}

.crm-page form[action*="cancella"] input[type="submit"]:hover,
input[value="Cancella"]:hover,
input[value*="CANCELLA"]:hover,
input[name="conferma"]:hover {
  background: #991b1b;
}

input[value="ANNULLA MODIFICHE"],
input[name="annulla"] {
  background: #64748b;
  box-shadow: 0 2px 6px rgba(100, 116, 139, .18);
}

input[value="ANNULLA MODIFICHE"]:hover,
input[name="annulla"]:hover {
  background: #475569;
}

form table[bgcolor] td,
table[bgcolor="#c6c6c6"] td,
table[bgcolor="#e6e6e6"] td,
table[bgcolor="#ccccff"] td,
table[bgcolor="#cccccc"] td {
  padding: 8px 10px;
}

.crm-page > center > form:first-of-type table,
.crm-home form,
.crm-toolbar {
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: var(--crm-surface) !important;
  box-shadow: var(--crm-shadow);
}

.crm-page > center > form:first-of-type table td {
  padding: 8px 7px;
}

.crm-page > center > form:first-of-type table td:first-child {
  background: transparent !important;
}

.crm-page > center > form:first-of-type table td:first-child a {
  display: inline-block;
  border-radius: 6px;
  background: var(--crm-primary);
  color: #fff;
  padding: 8px 12px;
  text-decoration: none;
}

.crm-page > center > table[width="100%"][border="1"],
.crm-page > table[width="100%"][border="1"] {
  margin-top: 14px;
  border-radius: 8px;
  background: var(--crm-surface);
  box-shadow: var(--crm-shadow);
}

.crm-page > center > table[width="100%"][border="1"] td,
.crm-page > table[width="100%"][border="1"] td {
  text-align: left;
}

.crm-page > center > table[width="100%"][border="1"] tr:first-child td,
.crm-page > table[width="100%"][border="1"] tr:first-child td {
  text-align: center;
}

legend {
  color: var(--crm-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.crm-top {
  background: #edf2f7;
  overflow: hidden;
}

.crm-top > font > table,
.crm-top > table {
  width: calc(100% - 16px) !important;
  min-height: 224px;
  margin: 8px;
  border-spacing: 0;
  border-collapse: separate;
  border-radius: 8px;
  background: var(--crm-surface);
  box-shadow: var(--crm-shadow);
  overflow: hidden;
}

.crm-top > font > table > tbody > tr > td,
.crm-top > table > tbody > tr > td,
.crm-top > font > table td:has(> table),
.crm-top > table td:has(> table) {
  vertical-align: top !important;
}

.crm-top img[src*="/media/utenti/"] {
  width: 58px !important;
  height: 58px !important;
  margin: 11px 10px;
  border: 2px solid var(--crm-primary-soft);
  border-radius: 50%;
  background: var(--crm-surface-soft);
  object-fit: cover;
}

.crm-top img[src*="logout"] {
  width: 34px !important;
  height: 34px !important;
  margin: 0 10px;
  opacity: .78;
}

.crm-top img[src*="msg"] {
  width: 28px !important;
  height: 28px !important;
  margin-bottom: 8px;
}

.crm-top .crm-ferie-envelope {
  position: relative;
  display: inline-flex !important;
  width: 34px;
  height: 28px;
  align-items: center;
  justify-content: center;
  margin: 0 10px 8px;
  border: 2px solid #047857;
  border-radius: 6px;
  background: #22c55e;
  color: #ffffff !important;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none !important;
}

.crm-top .crm-ferie-envelope::before,
.crm-top .crm-ferie-envelope::after {
  position: absolute;
  top: 6px;
  width: 18px;
  height: 2px;
  background: rgba(255, 255, 255, .8);
  content: "";
}

.crm-top .crm-ferie-envelope::before {
  left: 1px;
  transform: rotate(32deg);
}

.crm-top .crm-ferie-envelope::after {
  right: 1px;
  transform: rotate(-32deg);
}

.crm-top .crm-ferie-mini-envelope {
  display: inline-flex;
  width: 20px;
  height: 16px;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
  border: 1px solid #047857;
  border-radius: 4px;
  background: #22c55e;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.crm-top table table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.crm-top table table td {
  min-width: 0;
  padding: 10px 8px 8px;
  border-left: 1px solid #edf1f5;
  text-align: left !important;
}

.crm-top table table td:first-child {
  border-left: 0;
}

.crm-top b {
  display: block;
  margin-bottom: 5px;
  color: var(--crm-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.crm-top a {
  display: inline-block;
  max-width: 100%;
  margin: 2px 0;
  border: 1px solid transparent;
  padding: 4px 7px;
  border-radius: 5px;
  background: #f8fafc;
  color: var(--crm-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

.crm-top a[target="centro"] {
  max-width: 150px;
}

.crm-top a:hover {
  border-color: #b7d8d3;
  background: var(--crm-primary-soft);
  color: var(--crm-primary-dark);
  text-decoration: none;
}

.crm-page,
.crm-home-page {
  padding: 18px;
}

.crm-page > font,
.crm-home-page > font {
  font-family: inherit;
}

.crm-home {
  max-width: 1120px;
  margin: 0 auto;
}

.crm-home > table:first-of-type {
  width: 100% !important;
  border-collapse: separate;
  border-spacing: 16px;
}

.crm-home > table:first-of-type > tbody > tr > td,
.crm-home > table:first-of-type > tr > td {
  border-radius: 8px;
  background: var(--crm-surface);
  box-shadow: var(--crm-shadow);
  padding: 20px;
}

.crm-home > table:first-of-type > tbody > tr > td:only-child,
.crm-home > table:first-of-type > tr > td:only-child {
  min-height: 230px;
}

.crm-home > table:nth-of-type(2) {
  width: 100% !important;
  border-collapse: separate;
  border-spacing: 16px;
}

.crm-home > table:nth-of-type(2) > tbody > tr > td,
.crm-home > table:nth-of-type(2) > tr > td {
  border-radius: 8px;
  background: var(--crm-surface);
  box-shadow: var(--crm-shadow);
  padding: 18px;
}

.crm-home img[src*="logo"] {
  width: 160px !important;
  height: 160px !important;
  object-fit: contain;
}

.crm-home-online {
  width: 100%;
  margin-top: 10px;
  border-top: 1px solid var(--crm-line);
  padding-top: 12px;
  text-align: left;
}

.crm-home-online-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--crm-text);
  font-size: 13px;
  font-weight: 800;
}

.crm-home-online-head > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.crm-home-online-head strong {
  display: inline-flex;
  min-width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e5f4eb;
  color: #176b42;
  font-size: 12px;
}

.crm-home-online-live,
.crm-home-online-dot {
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2f9e64;
}

.crm-home-online-live {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 3px #e5f4eb;
}

.crm-home-online-list {
  display: flex;
  max-height: 142px;
  flex-wrap: wrap;
  gap: 7px;
  overflow: auto;
}

.crm-home-online-user {
  display: flex;
  min-width: 142px;
  flex: 1 1 142px;
  align-items: center;
  gap: 8px;
  border: 1px solid #dce5e1;
  border-radius: 6px;
  background: #f8fbfa;
  padding: 7px 9px;
  color: var(--crm-text) !important;
  text-decoration: none !important;
}

.crm-home-online-user:hover {
  border-color: #9bc8b2;
  background: #eef8f3;
}

.crm-home-online-user.is-me {
  cursor: default;
}

.crm-home-online-dot {
  width: 9px;
  height: 9px;
}

.crm-home-online-user > span {
  min-width: 0;
}

.crm-home-online-user b,
.crm-home-online-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-home-online-user b {
  font-size: 12px;
}

.crm-home-online-user small {
  margin-top: 2px;
  color: var(--crm-muted);
  font-size: 10px;
}

.crm-home-online-empty {
  color: var(--crm-muted);
  font-size: 12px;
}

.crm-home form {
  display: inline-block;
  min-width: 260px;
  border-radius: 8px;
  background: var(--crm-surface);
  box-shadow: var(--crm-shadow);
  padding: 18px;
  color: var(--crm-muted);
  font-weight: 700;
}

.crm-home fieldset table td {
  padding: 4px 6px;
}

.crm-page table,
.crm-home table {
  border-color: var(--crm-line);
}

.crm-page table[border="1"],
.crm-page table[border="1"] td,
.crm-page table[border="1"] th {
  border-color: var(--crm-line);
}

.crm-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, #eef6f5 0%, #f6f8fb 52%, #eef2f7 100%);
}

.crm-login-card {
  width: min(420px, 100%);
  border: 1px solid rgba(216, 222, 232, .9);
  border-radius: 8px;
  background: var(--crm-surface);
  box-shadow: var(--crm-shadow);
  overflow: hidden;
}

.crm-login-head {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--crm-line);
}

.crm-login-head h1 {
  margin: 0;
  color: var(--crm-text);
  font-size: 24px;
  letter-spacing: 0;
}

.crm-login-head p {
  margin: 4px 0 0;
  color: var(--crm-muted);
}

.crm-login-error {
  margin-top: 12px;
  border-radius: 6px;
  background: #fee2e2;
  color: #991b1b;
  padding: 8px 10px;
  font-weight: 700;
}

.crm-login-body {
  padding: 22px 24px 24px;
}

.crm-login-body label {
  display: block;
  margin-bottom: 6px;
  color: var(--crm-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.crm-login-body input[type="text"],
.crm-login-body input[type="password"] {
  width: 100%;
  margin-bottom: 14px;
}

.crm-login-body input[type="submit"] {
  width: 100%;
  margin-top: 4px;
}

.crm-footer {
  width: 100% !important;
  margin-top: 20px;
  border-radius: 8px;
  background: var(--crm-surface);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.crm-footer td {
  padding: 10px 14px;
  color: var(--crm-muted);
  font-size: 12px;
}

.crm-message-bar {
  padding: 8px;
  overflow: hidden;
  background: #edf2f7;
}

.crm-message-bar .crm-toolbar {
  min-height: 78px;
  padding: 8px;
}

.crm-message-toolbar {
  table-layout: fixed;
}

.crm-message-toolbar .crm-message-title {
  text-align: left;
}

.crm-message-toolbar .crm-message-title .crm-action {
  margin-right: 12px;
}

.crm-message-toolbar label {
  display: block;
  margin: 0 0 4px;
  color: var(--crm-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.crm-message-toolbar span {
  display: block;
  margin-top: 4px;
  color: var(--crm-muted);
  font-size: 11px;
  white-space: normal;
}

.crm-message-toolbar .crm-message-filters td {
  vertical-align: top;
}

.crm-message-bar .crm-toolbar td {
  padding: 6px 8px;
  white-space: nowrap;
}

.crm-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
  padding: 9px 13px;
  text-decoration: none !important;
  text-transform: uppercase;
}

.crm-action-primary {
  border-color: transparent !important;
  background: var(--crm-primary) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(15, 118, 110, .22);
}

.crm-action-primary:hover {
  background: var(--crm-primary-dark) !important;
  color: #fff !important;
}

.crm-action-secondary {
  border: 1px solid var(--crm-line);
  background: var(--crm-surface-soft);
  color: var(--crm-text) !important;
}

.crm-action-secondary:hover {
  border-color: var(--crm-primary);
  background: var(--crm-primary-soft);
  color: var(--crm-primary-dark) !important;
}

.crm-message-bar font[size="+1"] {
  color: var(--crm-text);
  font-size: 18px;
  font-weight: 900;
}

.crm-message-bar td[bgcolor="silver"] {
  background: transparent !important;
}

.crm-message-bar td[bgcolor="silver"] a:not(.crm-action) {
  display: inline-block;
  border-radius: 6px;
  background: var(--crm-primary);
  color: #fff;
  padding: 8px 12px;
  text-decoration: none;
}

.crm-module-bar center > a,
.crm-module-bar center > a:first-child,
.crm-message-bar .crm-toolbar > tbody > tr > td > a:not(.crm-action-primary),
.crm-message-bar .crm-toolbar > tr > td > a:not(.crm-action-primary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--crm-line);
  border-radius: 6px;
  background: var(--crm-surface-soft);
  color: var(--crm-text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .03em;
  padding: 8px 11px;
  text-decoration: none;
  text-transform: uppercase;
}

.crm-module-bar center > a:hover,
.crm-message-bar .crm-toolbar > tbody > tr > td > a:not(.crm-action-primary):hover,
.crm-message-bar .crm-toolbar > tr > td > a:not(.crm-action-primary):hover {
  border-color: var(--crm-primary);
  background: var(--crm-primary-soft);
  color: var(--crm-primary-dark);
}

.crm-message-bar input[type="text"] {
  width: 100%;
  max-width: 190px;
  padding: 6px 8px;
}

.crm-message-bar input[type="submit"] {
  min-height: 34px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  padding: 9px 13px;
}

.crm-write-button {
  min-width: 82px;
  font-size: 13px;
}

.crm-message-body {
  background: var(--crm-bg);
}

.crm-message-body > center > table[width="100%"][border="1"] {
  margin: 0 0 14px;
  border-radius: 8px;
  background: var(--crm-surface) !important;
  box-shadow: var(--crm-shadow);
}

.crm-message-body form > table[width="100%"][border="1"] {
  border-radius: 8px;
  background: var(--crm-surface) !important;
  box-shadow: var(--crm-shadow);
}

.crm-message-body input[value*="CANCELLA"],
.crm-message-body input[value*="SEGNA"] {
  margin: 10px 6px 10px 0;
}

.crm-message-standalone-toolbar {
  display: none;
}

html.crm-standalone-message-page .crm-message-standalone-toolbar {
  display: block;
  width: 100%;
  margin: 0 0 16px;
}

html.crm-standalone-message-page .crm-message-standalone-toolbar form {
  margin: 0;
}

html.crm-standalone-message-page .crm-message-standalone-toolbar .crm-message-toolbar {
  margin: 0;
}

.crm-message-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  width: 100%;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--crm-shadow);
}

.crm-message-tab {
  min-height: 40px;
  border: 1px solid var(--crm-line);
  border-radius: 7px;
  background: var(--crm-surface-soft);
  color: var(--crm-text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 9px 14px;
}

.crm-message-tab:hover {
  border-color: var(--crm-primary);
  background: var(--crm-primary-soft);
}

.crm-message-tab-active {
  border-color: var(--crm-primary);
  background: var(--crm-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
}

.crm-message-columns {
  display: block;
  width: 100%;
  margin-top: 6px;
}

.crm-message-received-panel,
.crm-message-sent-panel {
  display: block !important;
  width: 100% !important;
  min-width: 0;
  margin: 0 !important;
  overflow: visible !important;
}

body.crm-message-body.crm-show-ricevuti .crm-message-sent-panel,
body.crm-message-body.crm-show-inviati .crm-message-received-panel {
  display: none !important;
}

.crm-message-received-panel > tbody,
.crm-message-received-panel > tbody > tr,
.crm-message-received-panel > tbody > tr > td,
.crm-message-received-panel > tr,
.crm-message-received-panel > tr > td,
.crm-message-sent-panel > tbody,
.crm-message-sent-panel > tbody > tr,
.crm-message-sent-panel > tbody > tr > td,
.crm-message-sent-panel > tr,
.crm-message-sent-panel > tr > td {
  display: block !important;
  width: 100% !important;
}

.crm-message-received-panel > tbody > tr > td,
.crm-message-received-panel > tr > td,
.crm-message-sent-panel > tbody > tr > td,
.crm-message-sent-panel > tr > td {
  padding: 0 !important;
}

.crm-message-received-head,
.crm-message-sent-head {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  height: 96px;
  min-height: 96px;
  border-bottom: 1px solid var(--crm-line);
  border-radius: 8px 8px 0 0;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(23, 32, 51, .08);
}

.crm-message-received-title,
.crm-message-sent-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 150px;
  padding-top: 6px;
  color: var(--crm-muted);
  font-weight: 900;
}

.crm-message-received-title font[size="+1"],
.crm-message-sent-title font[size="+1"] {
  color: var(--crm-text);
  font-size: 16px;
  white-space: nowrap;
}

.crm-message-received-actions,
.crm-message-sent-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-message-received-actions input[type="submit"],
.crm-message-sent-actions input[type="submit"] {
  min-height: 31px;
  margin: 0;
  font-size: 11px;
  padding: 7px 9px;
  white-space: nowrap;
}

.crm-message-received-scroll,
.crm-message-sent-scroll {
  position: relative;
  height: 60vh;
  max-height: 60vh;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.crm-message-received-columns,
.crm-message-sent-columns {
  position: sticky;
  top: 96px;
  z-index: 25;
  margin: 0 !important;
  width: 100% !important;
  table-layout: fixed;
  border-radius: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  box-shadow: none !important;
}

.crm-message-sent-columns {
  top: 96px;
}

.crm-message-received-columns td,
.crm-message-sent-columns td {
  background: #dff4ed !important;
  box-shadow: 0 2px 0 rgba(23, 32, 51, .08);
}

.crm-message-received-columns td:first-child,
.crm-message-sent-columns td:first-child {
  border-left: 4px solid var(--crm-primary) !important;
}

.crm-message-received-scroll > table,
.crm-message-sent-scroll > table {
  margin: 0 !important;
  width: 100% !important;
  table-layout: fixed;
  border-radius: 0 0 8px 8px !important;
  box-shadow: none !important;
}

.crm-message-received-columns td:nth-child(1),
.crm-message-sent-columns td:nth-child(1),
.crm-message-received-scroll > table tr td:nth-child(1),
.crm-message-sent-scroll > table tr td:nth-child(1) {
  width: 42px !important;
}

.crm-message-received-columns td:nth-child(2),
.crm-message-sent-columns td:nth-child(2),
.crm-message-received-scroll > table tr td:nth-child(2),
.crm-message-sent-scroll > table tr td:nth-child(2) {
  width: 150px !important;
}

.crm-message-received-columns td:nth-child(3),
.crm-message-sent-columns td:nth-child(3),
.crm-message-received-scroll > table tr td:nth-child(3),
.crm-message-sent-scroll > table tr td:nth-child(3) {
  width: 92px !important;
}

.crm-message-received-columns td:nth-child(4),
.crm-message-sent-columns td:nth-child(4),
.crm-message-received-scroll > table tr td:nth-child(4),
.crm-message-sent-scroll > table tr td:nth-child(4) {
  width: 140px !important;
}

.crm-message-received-columns td:nth-child(6),
.crm-message-sent-columns td:nth-child(6),
.crm-message-received-scroll > table tr td:nth-child(6),
.crm-message-sent-scroll > table tr td:nth-child(6) {
  width: 145px !important;
}

.crm-message-body tr.crm-message-row.crm-row-even td {
  background: #ffffff !important;
}

.crm-message-body tr.crm-message-row.crm-row-odd td {
  background: #f3f7fb !important;
}

.crm-message-body tr.crm-message-row:hover td {
  background: #e8f0f8 !important;
}

.crm-message-body tr[bgcolor="yellow"].crm-row-even td {
  background: #ffffff !important;
}

.crm-message-body tr[bgcolor="yellow"].crm-row-odd td {
  background: #f3f7fb !important;
}

.crm-message-body tr[bgcolor="red"] td {
  background: #fee2e2 !important;
  color: #7f1d1d;
}

.crm-message-body tr[bgcolor="yellow"] td:first-child,
.crm-message-body tr[bgcolor="red"] td:first-child {
  border-left: 4px solid var(--crm-primary) !important;
}

.crm-message-body tr[bgcolor="red"] td:first-child {
  border-left-color: var(--crm-danger) !important;
}

.crm-message-body tr[bgcolor="yellow"]:hover td {
  background: #e8f0f8 !important;
}

.crm-message-body tr[bgcolor="red"]:hover td {
  background: #fecaca !important;
}

.crm-message-body table[border="1"] a {
  font-weight: 800;
}

.crm-component-link {
  display: inline-block;
  margin-top: 5px;
  border: 1px solid var(--crm-line);
  border-radius: 6px;
  background: var(--crm-primary-soft);
  color: var(--crm-primary-dark) !important;
  font-size: 11px;
  font-weight: 900 !important;
  padding: 4px 7px;
  text-decoration: none !important;
}

.crm-message-body table[border="1"] input[type="button"] {
  min-width: 28px;
  padding: 4px 7px;
}

.crm-message-body td.crm-message-subject {
  text-align: left !important;
}

.crm-message-body td.crm-message-subject a {
  justify-content: flex-start;
  text-align: left;
}

.crm-message-body td.crm-message-person {
  max-width: none;
  text-align: left !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-message-columns table[border="1"] td {
  padding: 7px 8px;
  font-size: 13px;
}

.crm-message-columns table:not(.crm-message-received-columns):not(.crm-message-sent-columns) > tbody > tr > td[width="130"] {
  width: 96px !important;
}

.crm-message-columns table:not(.crm-message-received-columns):not(.crm-message-sent-columns) > tbody > tr > td[width="80"] {
  width: 68px !important;
}

.crm-message-received-columns td:nth-child(1),
.crm-message-sent-columns td:nth-child(1),
.crm-message-received-scroll > table tr td:nth-child(1),
.crm-message-sent-scroll > table tr td:nth-child(1) {
  width: 42px !important;
}

.crm-message-received-columns td:nth-child(2),
.crm-message-sent-columns td:nth-child(2),
.crm-message-received-scroll > table tr td:nth-child(2),
.crm-message-sent-scroll > table tr td:nth-child(2) {
  width: 150px !important;
}

.crm-message-received-columns td:nth-child(3),
.crm-message-sent-columns td:nth-child(3),
.crm-message-received-scroll > table tr td:nth-child(3),
.crm-message-sent-scroll > table tr td:nth-child(3) {
  width: 92px !important;
}

.crm-message-received-columns td:nth-child(4),
.crm-message-sent-columns td:nth-child(4),
.crm-message-received-scroll > table tr td:nth-child(4),
.crm-message-sent-scroll > table tr td:nth-child(4) {
  width: 140px !important;
}

.crm-message-received-columns td:nth-child(6),
.crm-message-sent-columns td:nth-child(6),
.crm-message-received-scroll > table tr td:nth-child(6),
.crm-message-sent-scroll > table tr td:nth-child(6) {
  width: 145px !important;
}

@media (max-width: 1050px) {
  .crm-message-columns {
    grid-template-columns: 1fr;
  }

  .crm-message-received-scroll,
  .crm-message-sent-scroll {
    height: 48vh;
    max-height: 48vh;
  }
}

.crm-message-compose {
  width: min(920px, 96vw);
  margin: 0 auto;
}

.crm-message-compose td {
  vertical-align: top;
}

.crm-message-compose td:first-child {
  width: 170px;
  color: var(--crm-muted);
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.crm-message-compose span {
  display: block;
  margin-top: 6px;
  color: var(--crm-muted);
  font-size: 12px;
}

.crm-message-compose select,
.crm-message-compose input[type="text"],
.crm-message-compose textarea {
  width: 100%;
  max-width: 680px;
}

.crm-page > center > font[size="+1"],
.crm-module-body > center > b,
.crm-home-page > center > font[size="+1"] {
  display: inline-block;
  margin: 2px 0 16px;
  color: var(--crm-text);
  font-size: 22px;
  font-weight: 900;
}

.crm-section-home {
  margin: 0 0 10px;
  text-align: left;
}

.crm-section-home a {
  display: inline-block;
  border: 1px solid var(--crm-line);
  border-radius: 6px;
  background: var(--crm-surface);
  color: var(--crm-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  padding: 7px 10px;
  text-decoration: none;
}

.crm-section-home a:hover {
  border-color: var(--crm-primary);
  color: var(--crm-primary-dark);
  background: var(--crm-primary-soft);
}

.crm-page > center > font[size="+1"] + br + br {
  display: none;
}

.crm-page > center > form,
.crm-module-body > center > form {
  margin: 0 auto 18px;
}

.crm-page > center > form table,
.crm-module-bar .crm-toolbar,
.crm-message-bar .crm-toolbar {
  border-collapse: separate;
  border-spacing: 6px;
}

.crm-page > center > form table td,
.crm-module-bar .crm-toolbar td {
  color: var(--crm-muted);
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.crm-page > center > form table input[type="text"],
.crm-module-bar input[type="text"] {
  min-width: 86px;
}

.crm-page > center > form table select,
.crm-module-bar select {
  min-width: 150px;
}

.crm-page > center > form table td[bgcolor="silver"] a,
.crm-module-bar td[bgcolor="silver"] a {
  display: inline-block;
  border-radius: 6px;
  background: var(--crm-primary);
  color: #fff;
  padding: 8px 12px;
  text-decoration: none;
}

.crm-ca-search {
  width: min(760px, calc(100% - 24px));
}

.crm-ca-search-table {
  width: 100%;
}

.crm-ca-search-table td {
  white-space: nowrap;
}

.crm-ca-search-table input[type="text"] {
  min-width: 260px !important;
  background: #fff !important;
  color: var(--crm-text) !important;
  border: 1px solid #94a3b8 !important;
}

.crm-ca-search-table input[type="text"]::placeholder {
  color: #64748b;
}

.crm-ca-results {
  background: var(--crm-surface) !important;
}

.crm-ca-results tr:first-child td {
  background: #dbeafe !important;
  color: #0f172a !important;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-empty-row td {
  background: #f8fafc !important;
  color: #475569 !important;
  font-weight: 800;
  padding: 18px 14px !important;
  text-align: center;
}

.crm-module-bar {
  padding: 8px;
  overflow: auto;
  background: #edf2f7;
}

.crm-module-bar center > a:first-child {
  display: inline-block;
  margin-right: 10px;
}

.crm-module-bar font[size="+1"] {
  color: var(--crm-text);
  font-size: 18px;
  font-weight: 900;
}

.crm-module-bar .crm-toolbar {
  margin-top: 8px;
  padding: 8px;
}

.crm-assistenza-bar-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 auto 8px;
  max-width: 1180px;
}

.crm-module-bar .crm-assistenza-bar-head > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--crm-line);
  border-radius: 6px;
  background: var(--crm-surface-soft);
  color: var(--crm-text);
  font-size: 12px;
  font-weight: 900;
  padding: 8px 11px;
  text-decoration: none;
  text-transform: uppercase;
}

.crm-module-bar .crm-assistenza-bar-head > a:hover {
  border-color: var(--crm-primary);
  background: var(--crm-primary-soft);
  color: var(--crm-primary-dark);
}

.crm-assistenza-toolbar {
  display: block;
  width: min(1180px, calc(100% - 10px)) !important;
  margin: 0 auto !important;
}

.crm-assistenza-toolbar tbody {
  display: block;
  width: 100%;
}

.crm-assistenza-toolbar tr {
  display: grid;
  width: 100%;
  grid-template-columns: 68px 84px 142px minmax(240px, 1fr) 174px 132px 218px;
  align-items: end;
  gap: 6px;
}

.crm-assistenza-toolbar td {
  display: flex;
  min-width: 0;
  min-height: 46px;
  padding: 4px !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: normal;
}

.crm-assistenza-toolbar td > label {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  text-align: left;
  text-transform: uppercase;
}

.crm-assistenza-toolbar td > label > span {
  overflow: hidden;
  color: #334155;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-assistenza-toolbar input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.crm-assistenza-toolbar input[name="iidass"] {
  width: 100%;
}

.crm-assistenza-toolbar .crm-assistenza-content-search {
  min-width: 0;
}

.crm-assistenza-toolbar input[name="ricerca_contenuto"] {
  width: 100%;
  min-width: 0;
  border-color: #64748b;
  background: #fff;
}

.crm-assistenza-toolbar input[name="ricerca_contenuto"]::placeholder {
  color: #64748b;
}

.crm-assistenza-toolbar select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.crm-assistenza-toolbar td[bgcolor="silver"] {
  background: transparent !important;
}

.crm-assistenza-toolbar .crm-assistenza-new a {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.crm-assistenza-toolbar .crm-assistenza-filter-archive label {
  min-height: 36px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.crm-assistenza-toolbar .crm-assistenza-filter-archive input {
  flex: 0 0 auto;
}

.crm-assistenza-toolbar input[type="submit"] {
  min-width: 86px;
}

.crm-assistenza-toolbar .crm-assistenza-toolbar-actions {
  display: flex;
  min-width: 0;
  margin-left: 0;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.crm-assistenza-toolbar .crm-assistenza-toolbar-actions a {
  display: inline-flex;
  min-height: 36px;
  padding: 7px 11px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid #64748b;
  border-radius: 6px;
  background: #f8fafc;
  color: #1e293b;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.crm-assistenza-toolbar .crm-assistenza-toolbar-actions a:hover {
  border-color: var(--crm-primary);
  background: var(--crm-primary-soft);
  color: var(--crm-primary-dark);
}

@media (max-width: 1120px) {
  .crm-assistenza-toolbar tr {
    grid-template-columns: 68px 84px minmax(130px, .8fr) minmax(230px, 1.4fr) 170px;
  }

  .crm-assistenza-toolbar .crm-assistenza-filter-archive {
    grid-column: 3 / 4;
  }

  .crm-assistenza-toolbar .crm-assistenza-toolbar-actions {
    grid-column: 4 / 6;
  }
}

@media (max-width: 700px) {
  .crm-assistenza-toolbar tr {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .crm-assistenza-toolbar .crm-assistenza-content-search,
  .crm-assistenza-toolbar .crm-assistenza-filter-phase,
  .crm-assistenza-toolbar .crm-assistenza-filter-archive,
  .crm-assistenza-toolbar .crm-assistenza-toolbar-actions {
    grid-column: 1 / -1;
  }

  .crm-assistenza-toolbar .crm-assistenza-toolbar-actions {
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }
}

.crm-module-body {
  background: var(--crm-bg);
}

.crm-page > center > table[width="100%"]:not([border]),
.crm-module-body > center > table[width="100%"]:not([border]),
.crm-home > table[width="100%"]:not([border]) {
  margin-top: 14px;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: var(--crm-surface) !important;
  box-shadow: var(--crm-shadow);
  overflow: hidden;
}

.crm-page > center > table[width="100%"]:not([border]) td,
.crm-module-body > center > table[width="100%"]:not([border]) td,
.crm-home > table[width="100%"]:not([border]) td {
  padding: 12px 14px;
  color: var(--crm-muted);
  font-size: 13px;
}

.crm-page > center > table[width="100%"]:not([border]) b,
.crm-module-body > center > table[width="100%"]:not([border]) b {
  color: var(--crm-text);
  font-size: 16px;
}

tr[bgcolor="pink"] td {
  background: #fdf2f8 !important;
}

tr[bgcolor="yellow"] td {
  background: #fff8db !important;
}

tr[bgcolor="orange"] td {
  background: #ffedd5 !important;
}

tr[bgcolor="lightgreen"] td {
  background: #dcfce7 !important;
}

tr[bgcolor="#ff5555"] td,
tr[bgcolor="red"] td {
  background: #fee2e2 !important;
}

tr[bgcolor="#aaaaff"] td,
tr[bgcolor="#cc66ff"] td {
  background: #ede9fe !important;
}

tr[bgcolor="pink"] td:first-child,
tr[bgcolor="yellow"] td:first-child,
tr[bgcolor="orange"] td:first-child,
tr[bgcolor="lightgreen"] td:first-child,
tr[bgcolor="#ff5555"] td:first-child,
tr[bgcolor="red"] td:first-child,
tr[bgcolor="#aaaaff"] td:first-child,
tr[bgcolor="#cc66ff"] td:first-child {
  border-left: 4px solid var(--crm-line) !important;
}

tr[bgcolor="pink"] td:first-child {
  border-left-color: #ec4899 !important;
}

tr[bgcolor="yellow"] td:first-child {
  border-left-color: #eab308 !important;
}

tr[bgcolor="orange"] td:first-child {
  border-left-color: #f97316 !important;
}

tr[bgcolor="lightgreen"] td:first-child {
  border-left-color: #22c55e !important;
}

tr[bgcolor="#ff5555"] td:first-child,
tr[bgcolor="red"] td:first-child {
  border-left-color: #dc2626 !important;
}

tr[bgcolor="#aaaaff"] td:first-child,
tr[bgcolor="#cc66ff"] td:first-child {
  border-left-color: #7c3aed !important;
}

.crm-page table[border="1"] td[align="right"],
.crm-module-body table[border="1"] td[align="right"] {
  font-variant-numeric: tabular-nums;
  text-align: right !important;
}

.crm-page table[border="1"] td:first-child,
.crm-module-body table[border="1"] td:first-child {
  font-weight: 800;
}

.crm-popup {
  min-width: 360px;
  background: var(--crm-bg);
}

.crm-popup table[border="1"] {
  width: 100%;
  max-width: 680px;
  margin: 0 auto 16px;
  border-radius: 8px;
  background: var(--crm-surface);
  box-shadow: var(--crm-shadow);
}

.crm-popup table[border="1"] tr:first-child td {
  background: #eef6f5 !important;
}

.crm-popup table[border="1"] td:first-child {
  width: 34%;
  color: var(--crm-muted);
  font-size: 12px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.crm-popup a[href*="window.close"] {
  display: inline-block;
  border-radius: 6px;
  background: #64748b;
  color: #fff;
  padding: 8px 14px;
  text-decoration: none;
}

.crm-popup a[href*="window.close"]:hover {
  background: #475569;
}

.crm-archive #pulsanteStampa {
  margin: 12px 0;
}

.crm-archive #sezioneFiltro {
  width: 100%;
  max-width: 980px;
  margin: 0 auto 18px;
}

.crm-archive #sezioneFiltro table {
  width: 100%;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: var(--crm-surface) !important;
  box-shadow: var(--crm-shadow);
}

.crm-archive #sezioneFiltro td {
  padding: 8px;
  color: var(--crm-muted);
  font-size: 12px;
  font-weight: 800;
}

.crm-archive > center > table[width="100%"][border="1"] {
  border-radius: 8px;
  background: var(--crm-surface);
  box-shadow: var(--crm-shadow);
}

/* 2026 CRM presentation refresh */
body:not(.crm-top):not(.crm-login) {
  padding: 14px 16px 20px;
}

.crm-page,
.crm-module-body,
.crm-home-page,
.crm-archive,
.crm-popup {
  background:
    linear-gradient(180deg, #f7f9fc 0, var(--crm-bg) 220px);
}

.crm-page > center,
.crm-module-body > center,
.crm-archive > center {
  max-width: 1360px;
  margin: 0 auto;
}

.crm-page > center > font[size="+1"],
.crm-module-body > center > b,
.crm-home-page > center > font[size="+1"] {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--crm-line);
  color: var(--crm-text);
  font-size: 22px;
  line-height: 1.2;
  text-align: left;
}

.crm-section-home {
  margin-bottom: 12px;
}

.crm-section-home a,
.crm-page a[href*="javascript:history.back"],
.crm-home-page a[href*="javascript:history.back"] {
  min-height: 32px;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(23, 32, 51, .05);
}

.crm-top {
  background: #e8edf4;
}

.crm-top > font > table,
.crm-top > table {
  width: calc(100% - 14px) !important;
  min-height: 246px;
  margin: 7px;
  border: 1px solid #dce3ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(23, 32, 51, .1);
}

.crm-top table table {
  table-layout: fixed;
  border-spacing: 0;
}

.crm-top table table td {
  padding: 12px 9px 10px;
  border-left: 1px solid #e8edf4;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%) !important;
}

.crm-top b {
  margin: 0 0 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid #e7edf5;
  color: #344256;
  font-size: 12px;
}

.crm-top a {
  min-height: 26px;
  margin: 2px 0;
  border-radius: 7px;
  background: transparent;
  color: #243246;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
}

.crm-top a[target="centro"] {
  max-width: 170px;
}

.crm-top a:hover {
  border-color: #bdd2ff;
  background: var(--crm-primary-soft);
  color: var(--crm-primary-dark);
}

.crm-top img[src*="/media/utenti/"] {
  margin-top: 14px;
  border-color: #cfe0ff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .12);
}

.crm-page > center > form:first-of-type table,
.crm-module-bar .crm-toolbar,
.crm-message-bar .crm-toolbar,
form table[bgcolor],
table[bgcolor="#c6c6c6"],
table[bgcolor="#e6e6e6"],
table[bgcolor="#ccccff"],
table[bgcolor="#cccccc"] {
  border-radius: 8px;
  border-color: #dbe3ef;
  box-shadow: 0 8px 20px rgba(23, 32, 51, .07);
}

.crm-page > center > form:first-of-type table {
  width: auto;
  max-width: 100%;
}

.crm-page > center > form:first-of-type table td,
.crm-message-toolbar .crm-message-filters td,
.crm-module-bar .crm-toolbar td {
  padding: 8px 9px;
}

input,
select,
textarea {
  border-color: #cfd8e6;
  border-radius: 7px;
  box-shadow: inset 0 1px 1px rgba(23, 32, 51, .03);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(37, 99, 235, .18);
  border-color: #7aa2ff;
}

input[type="submit"],
input[type="button"],
button,
.crm-action {
  border-radius: 7px;
  box-shadow: 0 3px 8px rgba(37, 99, 235, .18);
}

input[value*="CANCELLA"],
.crm-page form[action*="cancella"] input[type="submit"],
input[value="Cancella"] {
  box-shadow: 0 3px 8px rgba(185, 28, 28, .18);
}

.crm-user-status-button,
.crm-page form[action*="cancella"] .crm-user-status-button {
  min-width: 82px;
  background: #059669 !important;
  color: #fff !important;
  box-shadow: 0 3px 8px rgba(5, 150, 105, .18) !important;
}

.crm-user-status-button:hover,
.crm-page form[action*="cancella"] .crm-user-status-button:hover {
  background: #047857 !important;
}

.crm-user-status-button-off,
.crm-page form[action*="cancella"] .crm-user-status-button-off {
  min-width: 112px;
  background: #64748b !important;
  box-shadow: 0 3px 8px rgba(100, 116, 139, .18) !important;
}

.crm-user-status-button-off:hover,
.crm-page form[action*="cancella"] .crm-user-status-button-off:hover {
  background: #475569 !important;
}

.crm-user-row-disabled td {
  background: #f1f5f9 !important;
  color: #64748b;
}

.crm-user-row-disabled a {
  color: #475569 !important;
}

.crm-user-edit-button {
  min-width: 92px;
}

.crm-user-disable-button,
.crm-page form[action*="cancella"] .crm-user-disable-button {
  background: #b91c1c !important;
  color: #fff !important;
  box-shadow: 0 3px 8px rgba(185, 28, 28, .22) !important;
}

.crm-user-disable-button:hover,
.crm-page form[action*="cancella"] .crm-user-disable-button:hover {
  background: #991b1b !important;
}

.crm-user-status-button-disabled,
.crm-user-status-button-disabled:hover {
  cursor: not-allowed !important;
  opacity: .55;
  background: #64748b !important;
  box-shadow: none !important;
}

.crm-user-inline-link {
  display: inline-block;
  margin-left: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #075985 !important;
  font-weight: 700;
  text-decoration: none;
}

.crm-assistenza-list {
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
  width: 100% !important;
  margin: 0 auto 14px;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 3px 12px rgba(15, 23, 42, .06);
  font-size: 14px;
}

.crm-assistenze-body,
.crm-assistenze-body button,
.crm-assistenze-body input,
.crm-assistenze-body select,
.crm-assistenze-body textarea {
  font-family: "Century Gothic", "Avenir Next", Futura, Arial, sans-serif;
}

.crm-assistenza-list td {
  padding: 9px 8px;
  border: 1px solid #a7b2c0 !important;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.3;
  color: #253247;
}

.crm-assistenza-list td:not(:last-child) {
  box-shadow: inset -1px 0 0 #77869a !important;
}

body.crm-module-body table.crm-assistenza-list tr:first-child td {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 8px;
  background: #344256 !important;
  color: #fff !important;
  white-space: normal;
  line-height: 1.15;
  font-size: 13px;
  font-weight: 700;
  border-color: #718096 !important;
}

body.crm-module-body table.crm-assistenza-list tr:first-child td:not(:last-child) {
  box-shadow: inset -2px 0 0 #94a3b8 !important;
}

body.crm-module-body table.crm-assistenza-list tr:first-child td:nth-child(2),
body.crm-module-body table.crm-assistenza-list tr:first-child td:nth-child(5) {
  text-align: left !important;
}

body.crm-module-body table.crm-assistenza-list tr:first-child td:nth-child(1),
body.crm-module-body table.crm-assistenza-list tr:first-child td:nth-child(3),
body.crm-module-body table.crm-assistenza-list tr:first-child td:nth-child(4),
body.crm-module-body table.crm-assistenza-list tr:first-child td:nth-child(6),
body.crm-module-body table.crm-assistenza-list tr:first-child td:nth-child(7) {
  text-align: center !important;
}

body.crm-module-body table.crm-assistenza-list tr:first-child td:nth-child(8) {
  text-align: right !important;
}

.crm-assistenza-list tr:not(:first-child):nth-child(even) td,
.crm-assistenza-list tr:not(:first-child)[bgcolor]:nth-child(even) td {
  background: #fff !important;
}

.crm-assistenza-list tr:not(:first-child):nth-child(odd) td,
.crm-assistenza-list tr:not(:first-child)[bgcolor]:nth-child(odd) td {
  background: #f5f7fa !important;
}

.crm-assistenza-list tr:not(:first-child):hover td,
.crm-assistenza-list tr:not(:first-child)[bgcolor]:hover td {
  background: #e9eef5 !important;
}

.crm-assistenza-list td:nth-child(1) {
  width: 5%;
  text-align: center !important;
}

.crm-assistenza-list td:nth-child(2) {
  width: 24%;
  text-align: left !important;
}

.crm-assistenza-list td:nth-child(3) {
  width: 10%;
  text-align: center !important;
}

.crm-assistenza-list td:nth-child(4) {
  width: 7%;
  text-align: center !important;
}

.crm-assistenza-list td:nth-child(5) {
  width: 21%;
  text-align: left !important;
}

.crm-assistenza-list td:nth-child(6) {
  width: 14%;
  text-align: center !important;
}

.crm-assistenza-list td:nth-child(7) {
  width: 10%;
  text-align: center !important;
}

.crm-assistenza-list td:nth-child(8) {
  width: 9%;
  text-align: right !important;
  white-space: nowrap;
}

.crm-assistenza-list col:nth-child(1) { width: 5%; }
.crm-assistenza-list col:nth-child(2) { width: 24%; }
.crm-assistenza-list col:nth-child(3) { width: 10%; }
.crm-assistenza-list col:nth-child(4) { width: 7%; }
.crm-assistenza-list col:nth-child(5) { width: 21%; }
.crm-assistenza-list col:nth-child(6) { width: 14%; }
.crm-assistenza-list col:nth-child(7) { width: 10%; }
.crm-assistenza-list col:nth-child(8) { width: 9%; }

.crm-assistenza-list tr:not(:first-child) td:nth-child(2) > a,
.crm-assistenza-list tr:not(:first-child) td:nth-child(5) > a {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.crm-assistenza-list a,
.crm-assistenza-list tr:not(:first-child) a,
.crm-assistenza-list tr:not(:first-child) a[href*="visualizza"],
.crm-assistenza-list tr:not(:first-child) a[href^="javascript:poppa"] {
  display: inline;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--crm-primary-dark);
  text-decoration: underline;
  white-space: normal;
}

body.crm-module-body table.crm-assistenza-list tr:first-child a {
  display: block;
  min-width: 0;
  padding: 3px 2px;
  border-radius: 0;
  color: #fff !important;
  text-decoration: none;
  text-align: inherit;
  white-space: normal;
}

body.crm-module-body table.crm-assistenza-list tr:first-child a:hover {
  color: #fff !important;
  text-decoration: underline;
}

.crm-assistenza-list img {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
}

.crm-assistenza-flag {
  display: inline-flex;
  min-width: 30px;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.crm-assistenza-flag-urgent {
  border-color: #dc2626;
  background: #fff;
  color: #b91c1c;
}

.crm-assistenza-summary {
  table-layout: fixed;
  margin-bottom: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(15, 23, 42, .06);
}

.crm-assistenza-summary td {
  padding: 12px 10px;
  border-right: 1px solid #dbe3ec;
  background: #f8fafc !important;
  color: #344256;
  white-space: normal;
  overflow-wrap: anywhere;
}

.crm-assistenza-summary td:last-child {
  border-right: 0;
}

.crm-assistenza-report-page {
  display: block;
  width: min(980px, calc(100% - 28px));
  margin: 18px auto 36px;
  color: #172033;
  font-family: "Century Gothic", CenturyGothic, AppleGothic, Arial, sans-serif;
  text-align: left;
}

.crm-assistenza-report-head {
  display: flex;
  min-height: 72px;
  padding: 14px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.crm-assistenza-report-head span {
  color: #2563eb;
  font-size: 11px;
  font-weight: 900;
}

.crm-assistenza-report-head h1 {
  margin: 3px 0 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.2;
}

.crm-assistenza-report-head a {
  display: inline-flex;
  min-height: 38px;
  padding: 8px 12px;
  align-items: center;
  justify-content: center;
  border: 1px solid #64748b;
  border-radius: 6px;
  background: #f8fafc;
  color: #1e293b !important;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none !important;
  white-space: nowrap;
}

.crm-assistenza-report-table-wrap {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.crm-assistenza-report-table {
  width: 100%;
  border: 0;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

.crm-assistenza-report-table td {
  padding: 11px 13px;
  border-right: 1px solid #dbe3ec;
  border-bottom: 1px solid #dbe3ec;
  color: #243044;
}

.crm-assistenza-report-table td:last-child {
  border-right: 0;
}

.crm-assistenza-report-table tr:first-child td {
  background: #dbeafe;
  color: #172033;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.crm-assistenza-report-table tr:not(:first-child):nth-child(odd) td {
  background: #f8fafc;
}

.crm-assistenza-report-table tr:not(:first-child):hover td {
  background: #eef6ff;
}

.crm-assistenza-report-table td:nth-child(1) {
  width: 34%;
}

.crm-assistenza-report-table td:nth-child(2) {
  width: 18%;
  text-align: center;
}

.crm-assistenza-report-table td:nth-child(3),
.crm-assistenza-report-table td:nth-child(4) {
  width: 24%;
  text-align: right;
}

.crm-assistenza-report-empty {
  padding: 24px !important;
  color: #64748b !important;
  font-weight: 800;
  text-align: center !important;
}

@media (max-width: 640px) {
  .crm-assistenza-report-page {
    width: calc(100% - 14px);
    margin-top: 8px;
  }

  .crm-assistenza-report-head {
    padding: 12px;
    align-items: stretch;
    flex-direction: column;
  }

  .crm-assistenza-report-head a {
    width: 100%;
    box-sizing: border-box;
  }

  .crm-assistenza-report-table {
    font-size: 11px;
  }

  .crm-assistenza-report-table td {
    padding: 9px 7px;
  }
}

table[border="1"] {
  border-color: #dbe3ef !important;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(23, 32, 51, .07);
}

table[border="1"] td,
table[border="1"] th {
  padding: 9px 10px;
  border-bottom-color: #edf1f6 !important;
}

table[border="1"] tr:first-child td,
table[border="1"] tr:first-child th {
  background: #eef4ff !important;
  color: #344256;
}

.crm-page table[border="1"] tr:not(:first-child):not([bgcolor]):nth-child(odd) td,
.crm-module-body table[border="1"] tr:not(:first-child):not([bgcolor]):nth-child(odd) td,
.crm-archive table[border="1"] tr:not(:first-child):not([bgcolor]):nth-child(odd) td {
  background: #fbfdff !important;
}

.crm-page table[border="1"] tr:not(:first-child):not([bgcolor]):nth-child(even) td,
.crm-module-body table[border="1"] tr:not(:first-child):not([bgcolor]):nth-child(even) td,
.crm-archive table[border="1"] tr:not(:first-child):not([bgcolor]):nth-child(even) td {
  background: #f4f7fb !important;
}

.crm-page table[border="1"] tr:not(:first-child):not([bgcolor]):hover td,
.crm-module-body table[border="1"] tr:not(:first-child):not([bgcolor]):hover td,
.crm-archive table[border="1"] tr:not(:first-child):not([bgcolor]):hover td {
  background: #eaf1ff !important;
}

table[border="1"] a {
  border-radius: 7px;
}

.crm-footer {
  border: 1px solid #dbe3ef;
}

.crm-home {
  max-width: 1240px;
}

.crm-home > table:first-of-type > tbody > tr > td,
.crm-home > table:first-of-type > tr > td,
.crm-home > table:nth-of-type(2) > tbody > tr > td,
.crm-home > table:nth-of-type(2) > tr > td {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(23, 32, 51, .07);
}

.crm-home img[src*="logo"] {
  width: 138px !important;
  height: 138px !important;
}

/* Alternanza righe coerente su tutte le tabelle dati */
.crm-page table[border="1"] tr:not(:first-child):nth-child(even) td,
.crm-module-body table[border="1"] tr:not(:first-child):nth-child(even) td,
.crm-archive table[border="1"] tr:not(:first-child):nth-child(even) td,
.crm-popup table[border="1"] tr:not(:first-child):nth-child(even) td {
  background: #ffffff !important;
}

.crm-page table[border="1"] tr:not(:first-child):nth-child(odd) td,
.crm-module-body table[border="1"] tr:not(:first-child):nth-child(odd) td,
.crm-archive table[border="1"] tr:not(:first-child):nth-child(odd) td,
.crm-popup table[border="1"] tr:not(:first-child):nth-child(odd) td {
  background: #f3f7fb !important;
}

.crm-page table[border="1"] tr[bgcolor="pink"]:nth-child(even) td,
.crm-module-body table[border="1"] tr[bgcolor="pink"]:nth-child(even) td {
  background: #fff1f7 !important;
}

.crm-page table[border="1"] tr[bgcolor="pink"]:nth-child(odd) td,
.crm-module-body table[border="1"] tr[bgcolor="pink"]:nth-child(odd) td {
  background: #fce7f1 !important;
}

.crm-page table[border="1"] tr[bgcolor="yellow"]:nth-child(even) td,
.crm-module-body table[border="1"] tr[bgcolor="yellow"]:nth-child(even) td {
  background: #fff8db !important;
}

.crm-page table[border="1"] tr[bgcolor="yellow"]:nth-child(odd) td,
.crm-module-body table[border="1"] tr[bgcolor="yellow"]:nth-child(odd) td {
  background: #fef0b7 !important;
}

.crm-page table[border="1"] tr[bgcolor="orange"]:nth-child(even) td,
.crm-module-body table[border="1"] tr[bgcolor="orange"]:nth-child(even) td {
  background: #ffedd5 !important;
}

.crm-page table[border="1"] tr[bgcolor="orange"]:nth-child(odd) td,
.crm-module-body table[border="1"] tr[bgcolor="orange"]:nth-child(odd) td {
  background: #fed7aa !important;
}

.crm-page table[border="1"] tr[bgcolor="lightgreen"]:nth-child(even) td,
.crm-module-body table[border="1"] tr[bgcolor="lightgreen"]:nth-child(even) td {
  background: #dcfce7 !important;
}

.crm-page table[border="1"] tr[bgcolor="lightgreen"]:nth-child(odd) td,
.crm-module-body table[border="1"] tr[bgcolor="lightgreen"]:nth-child(odd) td {
  background: #bbf7d0 !important;
}

.crm-page table[border="1"] tr[bgcolor="#aaaaff"]:nth-child(even) td,
.crm-page table[border="1"] tr[bgcolor="#cc66ff"]:nth-child(even) td,
.crm-module-body table[border="1"] tr[bgcolor="#aaaaff"]:nth-child(even) td,
.crm-module-body table[border="1"] tr[bgcolor="#cc66ff"]:nth-child(even) td {
  background: #ede9fe !important;
}

.crm-page table[border="1"] tr[bgcolor="#aaaaff"]:nth-child(odd) td,
.crm-page table[border="1"] tr[bgcolor="#cc66ff"]:nth-child(odd) td,
.crm-module-body table[border="1"] tr[bgcolor="#aaaaff"]:nth-child(odd) td,
.crm-module-body table[border="1"] tr[bgcolor="#cc66ff"]:nth-child(odd) td {
  background: #ddd6fe !important;
}

.crm-page table[border="1"] tr[bgcolor="#ff5555"]:nth-child(even) td,
.crm-page table[border="1"] tr[bgcolor="red"]:nth-child(even) td,
.crm-module-body table[border="1"] tr[bgcolor="#ff5555"]:nth-child(even) td,
.crm-module-body table[border="1"] tr[bgcolor="red"]:nth-child(even) td {
  background: #fee2e2 !important;
}

.crm-page table[border="1"] tr[bgcolor="#ff5555"]:nth-child(odd) td,
.crm-page table[border="1"] tr[bgcolor="red"]:nth-child(odd) td,
.crm-module-body table[border="1"] tr[bgcolor="#ff5555"]:nth-child(odd) td,
.crm-module-body table[border="1"] tr[bgcolor="red"]:nth-child(odd) td {
  background: #fecaca !important;
}

body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-read td,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-read td {
  background: #c7dcff !important;
  border-left-color: var(--crm-primary) !important;
}

body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-read.crm-row-odd td,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-read.crm-row-odd td {
  background: #b7d0ff !important;
}

body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-unread td,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-unread td {
  background: #fff4b8 !important;
  color: #3f3300;
}

body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-unread.crm-row-odd td,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-unread.crm-row-odd td {
  background: #ffeb94 !important;
}

body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-urgent td,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-urgent td {
  background: #ff6b6b !important;
  color: #5f0f0f;
}

body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-urgent.crm-row-odd td,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-urgent.crm-row-odd td {
  background: #ef4444 !important;
}

body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-read td:first-child,
body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-unread td:first-child,
body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-urgent td:first-child,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-read td:first-child,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-unread td:first-child,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-urgent td:first-child {
  border-left-width: 5px !important;
  border-left-style: solid !important;
}

body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-read td:first-child,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-read td:first-child {
  border-left-color: var(--crm-primary) !important;
}

body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-unread td:first-child,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-unread td:first-child {
  border-left-color: #c69200 !important;
}

body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-urgent td:first-child,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-urgent td:first-child {
  border-left-color: var(--crm-danger) !important;
}

body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-read:hover td,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-read:hover td {
  background: #a8c4f8 !important;
}

body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-unread:hover td,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-unread:hover td {
  background: #ffe16a !important;
}

body.crm-message-body .crm-message-received-scroll table[border="1"] tr.crm-message-row.crm-message-state-urgent:hover td,
body.crm-message-body .crm-message-sent-scroll table[border="1"] tr.crm-message-row.crm-message-state-urgent:hover td {
  background: #dc2626 !important;
}

/* Main mask alignment */
.crm-top > font > table,
.crm-top > table {
  min-height: 224px;
}

.crm-top table table {
  height: auto;
  table-layout: fixed;
}

.crm-top table table > tbody,
.crm-top table table > tr {
  display: block;
}

.crm-top table table > tbody > tr,
.crm-top table table > tr {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: start;
}

.crm-top table table td {
  display: block;
  padding: 8px 7px 7px !important;
  vertical-align: top !important;
}

.crm-top table table td br {
  display: none;
}

.crm-top table table td b {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin: 0 0 6px;
  border: 1px solid #d8e2ef;
  border-radius: 7px;
  background: #eef6ff;
  color: #16345c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
}

.crm-top table table td a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 24px;
  margin: 0 0 3px;
  border: 1px solid #d7dde8;
  border-radius: 6px;
  background: #ffffff;
  color: #172033;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  padding: 4px 7px;
  text-align: left;
  white-space: nowrap;
}

.crm-top table table td a > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-top-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 18px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--crm-primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 0 7px;
}

.crm-top-badge-urgent {
  min-width: 0;
  border: 1px solid #9f1d1d;
  background: #c62828;
  font-size: 9px;
  letter-spacing: 0;
}

.crm-chat-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.crm-chat-unread-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  background: transparent;
}

.crm-chat-bell-outline {
  position: relative;
  display: block;
  width: 14px;
  height: 12px;
  border: 2px solid #c62828;
  border-radius: 8px 8px 3px 3px;
  background: transparent;
}

.crm-chat-bell-outline::before {
  content: "";
  position: absolute;
  left: 3px;
  top: -6px;
  width: 4px;
  height: 4px;
  border: 2px solid #c62828;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.crm-chat-bell-outline::after {
  content: "";
  position: absolute;
  left: 3px;
  bottom: -6px;
  width: 4px;
  height: 4px;
  border: 2px solid #c62828;
  border-radius: 50%;
  background: #ffffff;
}

.crm-top table table td a:hover {
  border-color: var(--crm-primary);
  background: var(--crm-primary-soft);
}

.crm-top .crm-ferie-envelope {
  position: relative;
  display: inline-flex !important;
  width: 34px;
  height: 28px;
  align-items: center;
  justify-content: center;
  margin: 0 10px 8px;
  border: 2px solid #047857;
  border-radius: 6px;
  background: #22c55e;
  color: #ffffff !important;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none !important;
}

.crm-top .crm-ferie-envelope::before,
.crm-top .crm-ferie-envelope::after {
  position: absolute;
  top: 6px;
  width: 18px;
  height: 2px;
  background: rgba(255, 255, 255, .8);
  content: "";
}

.crm-top .crm-ferie-envelope::before {
  left: 1px;
  transform: rotate(32deg);
}

.crm-top .crm-ferie-envelope::after {
  right: 1px;
  transform: rotate(-32deg);
}

.crm-top .crm-ferie-mini-envelope {
  display: inline-flex;
  width: 20px;
  height: 16px;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
  border: 1px solid #047857;
  border-radius: 4px;
  background: #22c55e;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.crm-top .crm-pagamenti-mini-envelope {
  display: inline-flex;
  width: 20px;
  height: 16px;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
  border: 1px solid #991b1b;
  border-radius: 4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  animation: crmPaymentBlink 1s infinite;
}

.crm-top .crm-alert-bell,
.crm-top .crm-alert-bell-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b45309;
  background: #f59e0b;
  color: #ffffff !important;
  font-weight: 900;
  line-height: 1;
  text-decoration: none !important;
  animation: crmPaymentBlink 1s infinite;
}

.crm-top .crm-alert-bell {
  position: relative;
  width: 34px;
  height: 34px;
  margin: 0 10px 8px;
  border-radius: 50% 50% 45% 45%;
  font-size: 20px;
  box-shadow: 0 8px 18px rgba(180, 83, 9, .28);
}

.crm-top .crm-alert-bell::after {
  position: absolute;
  width: 10px;
  height: 4px;
  margin-top: 34px;
  border-radius: 999px;
  background: #92400e;
  content: "";
}

.crm-top .crm-alert-bell-mini {
  width: 20px;
  height: 18px;
  margin-right: 5px;
  border-radius: 50% 50% 45% 45%;
  font-size: 12px;
}

.crm-alert-resolve {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #78350f;
}

.crm-alert-resolve b {
  color: #92400e;
}

.crm-alert-resolve input[type="submit"] {
  min-width: 190px;
  border: 0;
  border-radius: 6px;
  background: #d97706;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.crm-work-sheet .crm-contract-table th,
.crm-work-sheet .crm-contract-table td {
  vertical-align: top;
}

.crm-work-sheet .crm-contract-table form select,
.crm-work-sheet .crm-contract-table form input[type="text"] {
  width: 100%;
  min-width: 92px;
  margin-bottom: 5px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 12px;
}

@keyframes crmPaymentBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.crm-home {
  max-width: 1240px;
}

.crm-home > table:first-of-type,
.crm-home > table:nth-of-type(2) {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 14px !important;
}

.crm-home > table:first-of-type > tbody > tr,
.crm-home > table:first-of-type > tr {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.crm-home > table:nth-of-type(2) > tbody > tr,
.crm-home > table:nth-of-type(2) > tr {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(360px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.crm-home > table:first-of-type > tbody > tr > td,
.crm-home > table:first-of-type > tr > td,
.crm-home > table:nth-of-type(2) > tbody > tr > td,
.crm-home > table:nth-of-type(2) > tr > td {
  width: auto !important;
  min-height: 0;
  margin: 0 !important;
  padding: 18px !important;
  vertical-align: top !important;
}

.crm-home > table:nth-of-type(2) > tbody > tr > td:first-child,
.crm-home > table:nth-of-type(2) > tr > td:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.crm-home form {
  width: 100%;
  min-width: 0;
  margin: 0;
  box-shadow: none;
}

.crm-home form::before,
.crm-home fieldset legend {
  display: block;
  min-height: 34px;
  margin: 0 0 12px;
  border: 1px solid #d8e2ef;
  border-radius: 7px;
  background: #eef6ff;
  color: #16345c;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 34px;
  padding: 0 12px;
  text-align: center;
  text-transform: uppercase;
}

.crm-home form::before {
  content: "Codice cliente";
}

.crm-home form {
  color: transparent;
}

.crm-home form input {
  color: var(--crm-text);
}

.crm-home fieldset {
  min-height: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--crm-surface-soft);
  padding: 0 12px 12px;
}

.crm-home fieldset table {
  width: 100%;
}

.crm-agenda-form {
  width: min(100%, 980px);
  table-layout: auto;
}

.crm-agenda-form input[type="text"],
.crm-agenda-form textarea {
  max-width: 100%;
  box-sizing: border-box;
}

.crm-agenda-form textarea {
  width: 100%;
}

.crm-agenda-share-toggle {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #1d4ed8;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.crm-agenda-share-toggle:hover,
.crm-agenda-share-toggle:focus {
  background: #1d4ed8;
}

.crm-agenda-share-fields {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.crm-agenda-share-fields label {
  display: grid;
  gap: 5px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.crm-agenda-share-fields select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 760px) {
  .crm-agenda-form,
  .crm-agenda-form > tbody {
    display: block;
    width: 100%;
  }

  .crm-agenda-form > tbody > tr,
  .crm-agenda-form > tr {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .crm-agenda-form td {
    width: auto !important;
    min-width: 0 !important;
  }

  .crm-agenda-form td:first-child {
    padding-bottom: 3px !important;
    font-weight: 900;
  }

  .crm-agenda-form td + td {
    padding-top: 3px !important;
  }

  .crm-agenda-client-times {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
  }

  .crm-agenda-client-times > input,
  .crm-agenda-client-times > label,
  .crm-agenda-client-times label input {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .crm-agenda-client-times > label {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
  }

  .crm-agenda-share-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Attivita collaboratori */
.crm-workboard {
  width: min(1500px, calc(100% - 24px));
  margin: 16px auto 28px;
  color: #24313b;
  font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
}

.crm-workboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 4px 2px 12px;
  border-bottom: 3px solid #23648a;
}

.crm-workboard-head h1,
.crm-workboard-head h2,
.crm-workboard-create h2 {
  margin: 0;
  color: #17384d;
  letter-spacing: 0;
}

.crm-workboard-head h1 { font-size: 25px; }
.crm-workboard-head h2,
.crm-workboard-create h2 { font-size: 18px; }
.crm-workboard-head p { margin: 5px 0 0; color: #5c6972; font-size: 13px; }

.crm-button,
.crm-icon-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #9baab4;
  border-radius: 5px;
  background: #fff;
  color: #23485e;
  padding: 7px 12px;
  font: 700 12px/1.2 "Century Gothic", "Trebuchet MS", Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.crm-button:hover,
.crm-icon-link:hover { border-color: #23648a; background: #edf6fb; color: #12394f; }
.crm-button-primary { border-color: #166342; background: #166342; color: #fff; }
.crm-button-primary:hover { border-color: #0f5035; background: #0f5035; color: #fff; }

.crm-workboard-views {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-workboard-views a,
.crm-personal-filters a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #91a5b1;
  border-radius: 4px;
  background: #fff;
  padding: 7px 11px;
  color: #244e65;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.crm-workboard-views a:hover,
.crm-personal-filters a:hover { border-color: #23648a; background: #edf6fb; }
.crm-workboard-views a.is-active,
.crm-personal-filters a.is-active { border-color: #17384d; background: #17384d; color: #fff; }

.crm-personal-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 12px 0;
  border: 1px solid #a9bbc5;
  border-left: 5px solid #23648a;
  border-radius: 5px;
  background: #f6f9fa;
  padding: 12px 14px;
}

.crm-personal-selector > div strong,
.crm-personal-selector > div span { display: block; }
.crm-personal-selector > div strong { color: #17384d; font-size: 15px; }
.crm-personal-selector > div span { margin-top: 3px; color: #5b6a73; font-size: 11px; }
.crm-personal-selector > b { color: #17384d; font-size: 15px; }
.crm-personal-selector form { display: flex; align-items: center; gap: 7px; }
.crm-personal-selector form select { min-width: 260px; }

.crm-personal-daily {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 12px;
  border: 1px solid #bd8b36;
  border-left: 5px solid #a86911;
  border-radius: 5px;
  background: #fff8e8;
  padding: 10px 13px;
  color: #65430d;
}

.crm-personal-daily strong { font-size: 12px; }
.crm-personal-daily span { font-size: 11px; line-height: 1.4; text-align: right; }

.crm-personal-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.crm-personal-kpis > div {
  min-height: 70px;
  border: 1px solid #b7c4cb;
  border-top: 4px solid #23648a;
  border-radius: 5px;
  background: #fff;
  padding: 10px 12px;
}

.crm-personal-kpis > div.is-danger { border-color: #cf9494; border-top-color: #ad2d2d; background: #fff4f4; }
.crm-personal-kpis strong { display: block; color: #17384d; font-size: 24px; line-height: 1.1; }
.crm-personal-kpis .is-danger strong { color: #9b2424; }
.crm-personal-kpis span { display: block; margin-top: 5px; color: #596973; font-size: 10px; font-weight: 800; }

.crm-personal-create {
  margin: 13px 0;
  border: 1px solid #aabac3;
  border-radius: 5px;
  background: #f7f9fa;
  padding: 13px;
}

.crm-personal-create header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.crm-personal-create header h2 { margin: 0; color: #17384d; font-size: 18px; }
.crm-personal-create header p { margin: 4px 0 0; color: #607079; font-size: 11px; }
.crm-personal-create header > span { border: 1px solid #bd8b36; border-radius: 4px; background: #fff7e7; padding: 5px 7px; color: #754d0b; font-size: 9px; font-weight: 800; white-space: nowrap; }
.crm-personal-create form { display: grid; grid-template-columns: minmax(250px, 1.6fr) 180px 150px; gap: 9px; margin-top: 11px; }
.crm-personal-create form .is-wide { grid-column: 1 / -1; }
.crm-personal-create form button { justify-self: end; }

.crm-personal-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 13px 0 9px; }
.crm-personal-list { display: grid; gap: 12px; }
.crm-personal-empty { border: 1px dashed #a9b8c1; border-radius: 5px; background: #f8fafb; padding: 22px; text-align: center; }
.crm-personal-empty strong,
.crm-personal-empty span { display: block; }
.crm-personal-empty strong { color: #294d61; font-size: 14px; }
.crm-personal-empty span { margin-top: 4px; color: #65747c; font-size: 11px; }

.crm-personal-card {
  overflow: hidden;
  border: 1px solid #a7b7c0;
  border-left: 5px solid #23648a;
  border-radius: 5px;
  background: #fff;
  padding: 13px;
}

.crm-personal-card.is-overdue { border-color: #cb8c8c; border-left-color: #ad2d2d; }
.crm-personal-card.is-complete { border-color: #91b39f; border-left-color: #32704c; background: #f8fbf9; }
.crm-personal-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.crm-personal-card > header > div { display: flex; min-width: 0; align-items: center; gap: 8px; }
.crm-personal-card h2 { margin: 0; color: #193e53; font-size: 18px; overflow-wrap: anywhere; }
.crm-personal-id { flex: 0 0 auto; border: 1px solid #9eb0ba; border-radius: 4px; background: #eef3f5; padding: 3px 6px; color: #425b69; font-size: 10px; font-weight: 800; }

.crm-personal-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(115px, 1fr));
  margin-top: 11px;
  border: 1px solid #c0cbd1;
  border-radius: 4px;
  background: #f7f9fa;
}

.crm-personal-meta > span { min-width: 0; border-right: 1px solid #cbd4d9; padding: 8px 9px; }
.crm-personal-meta > span:last-child { border-right: 0; }
.crm-personal-meta > span.is-overdue { background: #fff0f0; color: #9e2727; }
.crm-personal-meta small,
.crm-personal-meta b { display: block; }
.crm-personal-meta small { color: #697983; font-size: 8px; font-weight: 800; }
.crm-personal-meta b { margin-top: 3px; font-size: 11px; overflow-wrap: anywhere; }

.crm-personal-description { margin: 11px 0; border-left: 3px solid #7799ab; background: #f5f8f9; padding: 10px 12px; color: #2f414c; font-size: 13px; line-height: 1.5; }
.crm-personal-progress { display: grid; grid-template-columns: minmax(90px, 1fr) 48px; align-items: center; gap: 8px; }
.crm-personal-progress > span { height: 11px; overflow: hidden; border: 1px solid #a7b5bd; border-radius: 4px; background: #e6ebee; }
.crm-personal-progress i { display: block; height: 100%; background: #24704d; }
.crm-personal-progress b { color: #23495d; font-size: 12px; text-align: right; }

.crm-personal-timeline { margin-top: 12px; border-top: 1px solid #bec9cf; padding-top: 10px; }
.crm-personal-timeline h3 { margin: 0 0 7px; color: #294e62; font-size: 12px; }
.crm-personal-event { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: 10px; border-bottom: 1px solid #d7dde0; padding: 8px 0; }
.crm-personal-event:last-child { border-bottom: 0; }
.crm-personal-event time { color: #65747c; font-size: 10px; font-weight: 700; }
.crm-personal-event strong,
.crm-personal-event span { display: block; }
.crm-personal-event strong { color: #203f51; font-size: 11px; }
.crm-personal-event span { margin-top: 2px; color: #5f7079; font-size: 9px; font-weight: 700; }
.crm-personal-event p { margin: 5px 0 0; color: #344650; font-size: 12px; line-height: 1.45; }

.crm-personal-update {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 220px)) minmax(130px, 1fr);
  gap: 8px;
  margin-top: 12px;
  border: 1px solid #b8c5cc;
  border-radius: 5px;
  background: #f3f7f8;
  padding: 10px;
}

.crm-personal-update .is-wide { grid-column: 1 / -1; }
.crm-personal-update button { justify-self: end; }
.crm-personal-reminder { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin-top: 8px; }
.crm-personal-reminder input[type="text"] { max-width: 620px; }
.crm-personal-reminder button { min-height: 34px; border: 1px solid #a32929; border-radius: 4px; background: #fff; padding: 6px 10px; color: #9b2222; font: 800 10px/1.2 "Century Gothic", "Trebuchet MS", Arial, sans-serif; cursor: pointer; }
.crm-personal-reminder button:hover { background: #fff1f1; }

.crm-workboard-alert,
.crm-workboard-checkin {
  margin: 12px 0;
  border: 1px solid #8cb3c9;
  border-left: 5px solid #23648a;
  border-radius: 5px;
  background: #eef7fb;
  padding: 12px 14px;
  font-size: 14px;
}

.crm-workboard-alert.is-success { border-color: #79ae92; border-left-color: #28724b; background: #eef8f2; }
.crm-workboard-alert.is-error { border-color: #d58c8c; border-left-color: #a52f2f; background: #fff1f1; }
.crm-workboard-checkin { border-color: #d5a649; border-left-color: #b3770d; background: #fff8e8; }
.crm-workboard-checkin h2 { margin: 0 0 5px; color: #694600; font-size: 18px; }
.crm-workboard-checkin p { margin: 0 0 10px; font-size: 13px; }
.crm-workboard-checkin form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 9px; }

.crm-workboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.crm-workboard-kpis > div {
  min-height: 74px;
  border: 1px solid #bac5cc;
  border-top: 4px solid #23648a;
  border-radius: 5px;
  background: #fff;
  padding: 10px 12px;
}

.crm-workboard-kpis strong { display: block; color: #17384d; font-size: 25px; line-height: 1.1; }
.crm-workboard-kpis span { display: block; margin-top: 5px; color: #5a6871; font-size: 11px; font-weight: 700; text-transform: uppercase; }

.crm-workboard-filters,
.crm-workboard-create,
.crm-inline-update {
  border: 1px solid #bcc8cf;
  border-radius: 5px;
  background: #f7f9fa;
}

.crm-workboard-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin: 12px 0;
  padding: 10px;
}

.crm-workboard label,
.crm-inline-update label {
  display: grid;
  gap: 4px;
  color: #42515b;
  font-size: 10px;
  font-weight: 700;
}

.crm-workboard input[type="text"],
.crm-workboard input[type="date"],
.crm-workboard input[type="number"],
.crm-workboard select,
.crm-workboard textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  border: 1px solid #99a8b2;
  border-radius: 4px;
  background: #fff;
  color: #1f2d36;
  padding: 7px 9px;
  font: 13px/1.3 "Century Gothic", "Trebuchet MS", Arial, sans-serif;
}

.crm-workboard textarea { min-height: 78px; resize: vertical; }
.crm-workboard input:focus,
.crm-workboard select:focus,
.crm-workboard textarea:focus { outline: 3px solid rgba(35,100,138,.17); border-color: #23648a; }

.crm-workboard-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
  border: 1px solid #b8c5cd;
  border-radius: 5px;
  background: #f7f9fa;
  padding: 8px 10px;
  color: #40535f;
  font-size: 11px;
  font-weight: 700;
}

.crm-workboard-pager > div { display: flex; align-items: center; gap: 7px; }
.crm-workboard-pager strong { color: #183e54; font-size: 12px; }
.crm-workboard-pager a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid #879ca8;
  border-radius: 4px;
  background: #fff;
  padding: 5px 9px;
  color: #234f67;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}
.crm-workboard-pager a:hover { border-color: #23648a; background: #edf6fb; }
.crm-workboard-pager-bottom { margin-top: 10px; }

.crm-workboard-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid #9eafb9;
  border-radius: 5px;
  background: #fff;
}

.crm-workboard-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.crm-workboard-table th,
.crm-workboard-table td {
  border-right: 1px solid #cbd3d8;
  border-bottom: 1px solid #d4dade;
  padding: 9px 8px;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}

.crm-workboard-table th:last-child,
.crm-workboard-table td:last-child { border-right: 0; }
.crm-workboard-table tbody tr:last-child td { border-bottom: 0; }
.crm-workboard-table th { position: sticky; top: 0; z-index: 2; background: #294c61; color: #fff; font-size: 10px; text-align: center; text-transform: uppercase; }
.crm-workboard-table tbody tr:nth-child(even) { background: #f2f7f9; }
.crm-workboard-table tbody tr:hover { background: #eaf4f8; }
.crm-workboard-table td { font-size: 12px; }
.crm-workboard-table td strong { display: block; font-size: 13px; }
.crm-workboard-table td small { display: block; margin-top: 4px; color: #66737b; line-height: 1.35; }
.crm-workboard-table th:nth-child(1) { width: 11%; }
.crm-workboard-table th:nth-child(2) { width: 10%; }
.crm-workboard-table th:nth-child(3) { width: 25%; }
.crm-workboard-table th:nth-child(4) { width: 11%; }
.crm-workboard-table th:nth-child(5) { width: 10%; }
.crm-workboard-table th:nth-child(6) { width: 11%; }
.crm-workboard-table th:nth-child(7) { width: 22%; }

.crm-source,
.crm-state {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  border: 1px solid #94a4ad;
  border-radius: 4px;
  background: #fff;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.crm-source-attivita { border-color: #5b89a5; color: #235675; }
.crm-source-intervento { border-color: #9f7a35; color: #75520d; }
.crm-source-preventivo { border-color: #6f8d60; color: #3c6a35; }
.crm-source-assistenza { border-color: #4d8792; color: #26626c; }
.crm-source-rma { border-color: #9b6d58; color: #70422f; }
.crm-source-appuntamento,
.crm-source-agenda { border-color: #758d55; color: #4d682c; }
.crm-source-progetto { border-color: #716f9b; color: #4d4a79; }
.crm-source-quaderno { border-color: #a17847; color: #725126; }
.crm-source-ordine,
.crm-source-preparazione { border-color: #557d9d; color: #315b7b; }
.crm-source-merce_richiesta { border-color: #8a7460; color: #66503c; }
.crm-source-merce_ordinata { border-color: #537ea0; color: #315d7e; }
.crm-source-merce_consegna { border-color: #6c8c5d; color: #486b38; }
.crm-source-messaggio { border-color: #8a6c98; color: #654973; }
.crm-state-da-prendere { border-color: #c49b50; background: #fff7e8; color: #76510b; }
.crm-state-ricevuta { border-color: #8a9ba5; background: #f4f6f7; color: #42535d; }
.crm-state-in-lavorazione { border-color: #5485a2; background: #eef7fc; color: #1c5779; }
.crm-state-in-attesa { border-color: #9982ad; background: #f6f0fb; color: #66467e; }
.crm-state-chiusa { border-color: #67a17d; background: #edf8f1; color: #23643c; }
.crm-state-completata { border-color: #67a17d; background: #edf8f1; color: #23643c; }
.crm-state-annullata { border-color: #a7a7a7; background: #f2f2f2; color: #555; }

.crm-progress { display: grid; grid-template-columns: minmax(70px, 1fr) 38px; align-items: center; gap: 6px; }
.crm-progress span { height: 9px; overflow: hidden; border: 1px solid #aebac1; border-radius: 4px; background: #e4e9ec; }
.crm-progress i { display: block; height: 100%; background: #267a55; }
.crm-progress b { font-size: 11px; text-align: right; }

.crm-work-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.crm-work-actions details { flex: 1 1 100%; border-top: 1px solid #d1d8dc; padding-top: 6px; }
.crm-work-actions summary { color: #235675; font-size: 11px; font-weight: 700; cursor: pointer; }
.crm-inline-update { display: grid; gap: 7px; margin-top: 7px; padding: 8px; }
.crm-work-history { max-height: 250px; overflow: auto; margin-top: 7px; border: 1px solid #c8d0d5; background: #fff; padding: 5px 7px; }
.crm-work-history p { margin: 0; padding: 6px 0; border-bottom: 1px solid #dde2e5; }
.crm-work-history p:last-child { border-bottom: 0; }
.crm-work-history strong,
.crm-work-history span,
.crm-work-history small { display: block; font-size: 10px; line-height: 1.35; }
.crm-work-history span { margin-top: 2px; color: #334c5a; }
.crm-work-history small { color: #65727a; }

.crm-workboard-daily { margin: 12px 0; border: 1px solid #9eafb9; border-radius: 5px; background: #fff; }
.crm-workboard-daily > summary { padding: 10px 12px; color: #234f67; font-size: 12px; font-weight: 700; cursor: pointer; }
.crm-workboard-daily > div { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 7px; padding: 0 9px 9px; }
.crm-workboard-daily article { position: relative; border: 1px solid #c7d0d5; border-radius: 4px; background: #f7f9fa; padding: 9px; }
.crm-workboard-daily article strong { display: block; padding-right: 42px; color: #233c4a; font-size: 12px; }
.crm-workboard-daily article time { position: absolute; top: 9px; right: 9px; color: #64727b; font-size: 10px; }
.crm-workboard-daily article p { margin: 6px 0 0; color: #4b5962; font-size: 11px; line-height: 1.45; }
.crm-message-flow {
  margin: 12px 0;
  border: 1px solid #9eafb9;
  border-radius: 5px;
  background: #fff;
}
.crm-message-flow > summary {
  padding: 10px 12px;
  color: #234f67;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.crm-message-flow-table-wrap { max-height: 370px; overflow: auto; border-top: 1px solid #c4ced4; }
.crm-message-flow table { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: fixed; }
.crm-message-flow th,
.crm-message-flow td { border-right: 1px solid #d3dade; border-bottom: 1px solid #d6dce0; padding: 8px; text-align: left; }
.crm-message-flow th:last-child,
.crm-message-flow td:last-child { border-right: 0; }
.crm-message-flow th { position: sticky; top: 0; z-index: 1; background: #36576a; color: #fff; font-size: 9px; text-align: center; }
.crm-message-flow td { color: #344752; font-size: 11px; }
.crm-message-flow td:nth-child(n+3) { text-align: center; }
.crm-message-flow td strong,
.crm-message-flow td small { display: block; }
.crm-message-flow td small { margin-top: 2px; color: #71808a; font-size: 9px; }
.crm-message-flow tr:nth-child(even) td { background: #f5f8fa; }
.crm-message-flow tr.is-unread td { background: #fff7d9; }
.crm-message-flow tr.is-unread td:nth-child(4) b { color: #a52f2f; }
.crm-message-flow td a { display: inline-flex; border: 1px solid #7c98a8; border-radius: 4px; padding: 4px 7px; color: #24536d; font-size: 9px; font-weight: 800; text-decoration: none; }
.crm-message-flow td a:hover { border-color: #23648a; background: #edf6fb; }
.crm-workboard-summary {
  margin: 12px 0;
  border: 1px solid #aebdc6;
  border-radius: 5px;
  background: #fff;
  padding: 12px;
}
.crm-workboard-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.crm-workboard-summary-head h2 { margin: 0; color: #1f4054; font-size: 17px; }
.crm-workboard-summary-head p { margin: 3px 0 0; color: #61717a; font-size: 11px; }
.crm-workboard-summary-head > span { border: 1px solid #9ab0bd; border-radius: 4px; background: #edf3f6; padding: 6px 8px; color: #344f5f; font-size: 10px; font-weight: 800; }
.crm-workboard-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 8px; }
.crm-collaborator-summary { display: block; border: 1px solid #c3ced4; border-left: 4px solid #457b99; border-radius: 4px; background: #fafcfd; padding: 9px; color: #263e4d; text-decoration: none; }
.crm-collaborator-summary:hover { border-color: #6d9eb8; background: #f0f7fa; }
.crm-collaborator-summary.is-stale { border-left-color: #bd3c34; background: #fff7f6; }
.crm-collaborator-summary header { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.crm-collaborator-summary header strong { font-size: 14px; text-transform: uppercase; }
.crm-collaborator-summary header span { border: 1px solid; border-radius: 3px; padding: 3px 5px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.crm-collaborator-summary header span.is-done { border-color: #77a58d; background: #eaf6ef; color: #286143; }
.crm-collaborator-summary header span.is-missing { border-color: #d09b5a; background: #fff5e6; color: #80500e; }
.crm-collaborator-summary > div { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; margin-top: 8px; }
.crm-collaborator-summary > div span { border-right: 1px solid #d7dfe3; color: #64737c; font-size: 8px; text-align: center; }
.crm-collaborator-summary > div span:last-child { border-right: 0; }
.crm-collaborator-summary > div b { display: block; color: #24485d; font-size: 15px; }
.crm-collaborator-summary > div .is-alert b { color: #a42626; }
.crm-collaborator-summary > small { display: block; margin-top: 8px; color: #687780; font-size: 9px; }
.crm-workboard-create { margin-top: 16px; padding: 14px; }
.crm-workboard-create form { display: grid; grid-template-columns: 1.2fr 1fr .65fr .75fr; gap: 9px; margin-top: 10px; }
.crm-workboard-create form label:first-child,
.crm-workboard-create form label:nth-child(2) { grid-column: span 2; }
.crm-workboard-create form label:nth-child(2) textarea { min-height: 90px; }
.crm-workboard-create form .crm-button { align-self: end; }

@media (max-width: 900px) {
  .crm-workboard { width: calc(100% - 14px); margin-top: 9px; }
  .crm-workboard-head { align-items: flex-start; }
  .crm-personal-selector { align-items: stretch; flex-direction: column; }
  .crm-personal-selector form select { min-width: 0; }
  .crm-personal-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-personal-meta > span { border-bottom: 1px solid #cbd4d9; }
  .crm-personal-meta > span:nth-child(even) { border-right: 0; }
  .crm-personal-meta > span:last-child { border-bottom: 0; }
  .crm-personal-create form,
  .crm-personal-update { grid-template-columns: 1fr 1fr; }
  .crm-personal-create form .is-wide,
  .crm-personal-update .is-wide { grid-column: 1 / -1; }
  .crm-workboard-kpis { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .crm-workboard-create form { grid-template-columns: 1fr 1fr; }
  .crm-workboard-daily > div { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .crm-workboard-summary-grid { grid-template-columns: repeat(2, minmax(210px, 1fr)); }
  .crm-workboard-create form label:first-child,
  .crm-workboard-create form label:nth-child(2) { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .crm-workboard-head { display: grid; }
  .crm-workboard-head h1 { font-size: 21px; }
  .crm-workboard-views,
  .crm-workboard-views a { width: 100%; box-sizing: border-box; }
  .crm-personal-selector form,
  .crm-personal-reminder { align-items: stretch; flex-direction: column; }
  .crm-personal-kpis,
  .crm-personal-create form,
  .crm-personal-update,
  .crm-personal-meta { grid-template-columns: 1fr; }
  .crm-personal-meta > span { border-right: 0; }
  .crm-personal-event { grid-template-columns: 1fr; gap: 3px; }
  .crm-personal-create form label,
  .crm-personal-update label { grid-column: 1 !important; }
  .crm-personal-create form button,
  .crm-personal-update button { width: 100%; justify-self: stretch; }
  .crm-workboard-checkin form,
  .crm-workboard-create form { grid-template-columns: 1fr; }
  .crm-workboard-create form label { grid-column: 1 !important; }
  .crm-workboard-filters > * { flex: 1 1 140px; }
  .crm-workboard-pager { align-items: stretch; flex-direction: column; }
  .crm-workboard-pager > div { justify-content: space-between; }
  .crm-workboard-summary-head { align-items: flex-start; flex-direction: column; }
  .crm-workboard-summary-grid { grid-template-columns: 1fr; }
  .crm-message-flow-table-wrap { max-height: 310px; }
  .crm-workboard-table-wrap { overflow: visible; border: 0; background: transparent; }
  .crm-workboard-table,
  .crm-workboard-table tbody,
  .crm-workboard-table tr,
  .crm-workboard-table td { display: block; width: 100%; min-width: 0; box-sizing: border-box; }
  .crm-workboard-table thead { display: none; }
  .crm-workboard-table tbody { display: grid; gap: 10px; }
  .crm-workboard-table tr {
    overflow: hidden;
    border: 1px solid #9eafb9;
    border-radius: 5px;
    background: #fff;
  }
  .crm-workboard-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    border-right: 0;
    padding: 9px;
  }
  .crm-workboard-table td::before {
    content: attr(data-label);
    color: #526773;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.35;
  }
  .crm-workboard-table td.crm-work-actions { display: grid; align-items: stretch; }
  .crm-workboard-table td.crm-work-actions > * { min-width: 0; }
  .crm-workboard-table td.crm-empty { display: block; }
  .crm-workboard-table td.crm-empty::before { content: none; }
  .crm-progress { min-width: 0; }
  .crm-workboard-daily > div { grid-template-columns: 1fr; }
}

/* Portale clienti collegato alle richieste di intervento */
.crm-service-requests-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.crm-service-requests-head-actions a,
.crm-service-request-section-title > a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid #175f82;
  border-radius: 4px;
  padding: 7px 12px;
  background: #176b8a;
  color: #fff !important;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none !important;
}

.crm-service-requests-head-actions a:first-child {
  border-color: #116b5c;
  background: #15836f;
}

.crm-service-request-web-data {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid #bdd0d9;
  border-bottom: 1px solid #bdd0d9;
  background: #bdd0d9;
}

.crm-service-request-web-data > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 11px 13px;
  background: #f6fafb;
}

.crm-service-request-web-data span {
  color: #4b6878;
  font-size: 10px;
  font-weight: 900;
}

.crm-service-request-web-data strong {
  overflow-wrap: anywhere;
  color: #17394c;
  font-size: 13px;
}

.crm-service-request-web-data .is-ticket {
  border-left: 5px solid #15836f;
  background: #edf8f4;
}

.crm-service-request-web-data .is-stopped {
  border-left: 5px solid #c84b3b;
  background: #fff1ee;
  color: #8e2f23;
}

.crm-service-request-web-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 11px 13px;
  border-bottom: 1px solid #bdd0d9;
  background: #fff;
}

.crm-service-request-web-files > strong {
  margin-right: 4px;
  color: #38596b;
  font-size: 11px;
}

.crm-service-request-web-files a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  border: 1px solid #91aebb;
  border-radius: 4px;
  padding: 5px 9px;
  background: #f3f8fa;
  color: #175f82 !important;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none !important;
}

.crm-service-request-web-files small { color: #627b88; }

.crm-service-request-web-badge {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  justify-content: center;
  margin: 4px 0 0 5px;
  border: 1px solid #13705f;
  border-radius: 3px;
  padding: 1px 5px;
  background: #e1f4ef;
  color: #0f6656;
  font-size: 9px;
  font-weight: 900;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .crm-service-request-web-data { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .crm-service-requests-head-actions { justify-content: stretch; }
  .crm-service-requests-head-actions a { flex: 1 1 auto; }
  .crm-service-request-web-data { grid-template-columns: 1fr; }
}

/* Richieste di intervento */
.crm-service-requests {
  width: min(1480px, calc(100% - 28px));
  margin: 14px auto 32px;
  color: #203644;
  font-family: "Century Gothic", CenturyGothic, Arial, sans-serif;
  font-size: 14px;
}

.crm-service-requests * { box-sizing: border-box; }
.crm-service-requests [hidden] { display: none !important; }

.crm-service-requests-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 3px solid #2d7292;
}

.crm-service-requests-head h1 {
  margin: 0;
  color: #173f55;
  font-size: 25px;
  line-height: 1.15;
}

.crm-service-requests-head p { margin: 3px 0 0; color: #527080; }

.crm-service-request-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #91bea2;
  border-left: 5px solid #2f8350;
  border-radius: 4px;
  background: #eef8f1;
  color: #245b38;
  font-weight: 700;
}

.crm-service-request-status.is-error {
  border-color: #dc9a9a;
  border-left-color: #b93636;
  background: #fff2f2;
  color: #8c2424;
}

.crm-service-request-create,
.crm-service-request-editor,
.crm-service-request-list {
  margin-bottom: 16px;
  border: 1px solid #b8cbd6;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(24, 56, 73, .08);
}

.crm-service-request-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid #b8cbd6;
  background: #e8f1f5;
  color: #173f55;
  font-size: 17px;
  font-weight: 800;
}

.crm-service-request-section-title > div { display: flex; align-items: baseline; gap: 10px; }
.crm-service-request-section-title span { color: #2d7292; font-size: 11px; font-weight: 900; }
.crm-service-request-section-title h2 { margin: 0; color: #173f55; font-size: 17px; line-height: 1.2; }

.crm-service-request-create > form,
.crm-service-request-edit-form,
.crm-service-request-appointment-form,
.crm-service-request-filters { padding: 14px; }

.crm-service-request-grid,
.crm-service-request-free,
.crm-service-request-appointment-grid,
.crm-service-request-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px 13px;
  align-items: end;
}

.crm-service-request-grid > label,
.crm-service-request-free > label,
.crm-service-request-appointment-grid > label,
.crm-service-request-filters > label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #355467;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.crm-service-request-grid .is-wide,
.crm-service-request-free .is-wide { grid-column: span 2; }

.crm-service-requests input[type="text"],
.crm-service-requests input[type="search"],
.crm-service-requests input[type="date"],
.crm-service-requests input[type="time"],
.crm-service-requests select,
.crm-service-requests textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #9eb6c4;
  border-radius: 4px;
  padding: 8px 9px;
  background: #fff;
  color: #172f3d;
  font: inherit;
}

.crm-service-requests textarea { min-height: 105px; resize: vertical; }
.crm-service-requests input:focus,
.crm-service-requests select:focus,
.crm-service-requests textarea:focus {
  outline: 3px solid rgba(35, 116, 156, .16);
  border-color: #23749c;
}

.crm-service-request-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}

.crm-service-request-mode label {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid #9eb6c4;
  border-radius: 4px;
  background: #f5f8fa;
  color: #244a60;
  font-weight: 800;
  cursor: pointer;
}

.crm-service-request-registry {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: 11px 13px;
  align-items: end;
  margin-bottom: 12px;
}
.crm-service-request-client-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.crm-service-request-client-search label { display: grid; gap: 5px; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.crm-service-request-registry > label { display: grid; gap: 5px; min-width: 0; color: #355467; font-size: 12px; font-weight: 800; text-transform: uppercase; }

.crm-service-request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 13px;
}

.crm-service-requests button,
.crm-service-requests .crm-service-request-actions a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid #1f6384;
  border-radius: 4px;
  padding: 8px 13px;
  background: #23749c;
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.crm-service-requests button:hover,
.crm-service-requests .crm-service-request-actions a:hover { background: #195a79; }

.crm-service-request-association {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 9px 14px;
  border-bottom: 1px solid #cbd9e1;
  background: #f7fafb;
  color: #355467;
  font-weight: 700;
}

.crm-service-request-appointment-form {
  border-top: 1px solid #cbd9e1;
  background: #f8fbfc;
}

.crm-service-request-history { padding: 0 14px 14px; }
.crm-service-request-table-wrap { width: 100%; overflow-x: auto; }
.crm-service-request-table-wrap table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.crm-service-request-table-wrap th,
.crm-service-request-table-wrap td {
  border-right: 1px solid #b7cad5;
  border-bottom: 1px solid #cbd9e1;
  padding: 9px 8px;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}
.crm-service-request-table-wrap th:last-child,
.crm-service-request-table-wrap td:last-child { border-right: 0; }
.crm-service-request-table-wrap th {
  background: #2b6f8f;
  color: #fff;
  font-size: 12px;
  text-align: center;
  text-transform: uppercase;
}
.crm-service-request-table-wrap tbody tr:nth-child(even) { background: #edf5f8; }
.crm-service-request-table-wrap tbody tr:hover { background: #dcecf3; }
.crm-service-request-table-wrap td:nth-child(1),
.crm-service-request-table-wrap td:nth-child(2),
.crm-service-request-table-wrap td:nth-last-child(1) { text-align: center; }

.crm-service-request-badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  border: 1px solid #9eb6c4;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f0f5f7;
  color: #2d5063;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.crm-service-request-badge.is-aperta,
.crm-service-request-badge.is-non_associata { border-color: #d1a05c; background: #fff5dd; color: #7b4c0a; }
.crm-service-request-badge.is-in_gestione,
.crm-service-request-badge.is-tecnico_associato { border-color: #6ea2bc; background: #e8f4fa; color: #1d5a79; }
.crm-service-request-badge.is-chiusa,
.crm-service-request-badge.is-trasferita_appuntamento { border-color: #7cac8b; background: #edf8f0; color: #28603b; }
.crm-service-request-empty { padding: 24px; color: #627b88; text-align: center; }

@media (max-width: 900px) {
  .crm-service-request-grid,
  .crm-service-request-free,
  .crm-service-request-appointment-grid,
  .crm-service-request-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-service-request-table-wrap table { min-width: 900px; }
  .crm-service-request-registry { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .crm-service-requests { width: calc(100% - 14px); margin-top: 7px; font-size: 15px; }
  .crm-service-requests-head { display: block; }
  .crm-service-requests-head h1 { font-size: 21px; }
  .crm-service-request-grid,
  .crm-service-request-free,
  .crm-service-request-appointment-grid,
  .crm-service-request-filters { grid-template-columns: 1fr; }
  .crm-service-request-grid .is-wide,
  .crm-service-request-free .is-wide,
  .crm-service-request-client-search { grid-column: auto; }
  .crm-service-request-client-search { grid-template-columns: 1fr; }
  .crm-service-request-section-title { font-size: 16px; }
}

/* Assistenze: avviso cliente SMS / WhatsApp */
.crm-assistenza-notify-inline {
  display: inline-flex;
  min-height: 28px;
  margin-top: 7px;
  padding: 5px 9px;
  align-items: center;
  border: 1px solid #b91c1c;
  border-radius: 5px;
  background: #fff;
  color: #991b1b !important;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none !important;
  white-space: nowrap;
}

.crm-assistenza-notify-inline:hover {
  background: #fef2f2;
}

.crm-assistenza-notify-inline.is-sent {
  border-color: #15803d;
  background: #f0fdf4;
  color: #166534 !important;
}

.crm-assistenza-notify-meta {
  display: block;
  margin-top: 4px;
  color: #3f4d5f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.crm-assistenza-notification-status {
  display: grid;
  width: min(720px, calc(100% - 24px));
  box-sizing: border-box;
  margin: 0 auto 18px;
  padding: 13px 15px;
  border: 1px solid;
  border-radius: 5px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 14px;
  color: #172033;
  font-family: "Century Gothic", CenturyGothic, AppleGothic, Arial, sans-serif;
  text-align: left;
}

.crm-assistenza-notification-status strong,
.crm-assistenza-notification-status span {
  min-width: 0;
}

.crm-assistenza-notification-status span {
  grid-column: 1;
  font-size: 12px;
}

.crm-assistenza-notification-status a {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 11px;
  font-weight: 800;
}

.crm-assistenza-notification-status.is-sent {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.crm-assistenza-notification-status.is-pending {
  border-color: #fca5a5;
  background: #fff7f7;
  color: #991b1b;
}

.crm-customer-notice-last-sent {
  display: block;
  margin-top: 4px;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.crm-customer-notice-page {
  width: min(1120px, calc(100% - 32px));
  margin: 18px auto 36px;
  color: #172033;
  font-family: "Century Gothic", CenturyGothic, AppleGothic, Arial, sans-serif;
  text-align: left;
}

.crm-customer-notice-header {
  display: flex;
  min-height: 82px;
  padding: 18px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.crm-customer-notice-kicker {
  margin: 0 0 4px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.crm-customer-notice-header h1 {
  margin: 0;
  color: #111827;
  font-size: 24px;
  line-height: 1.2;
}

.crm-customer-notice-header p:not(.crm-customer-notice-kicker) {
  margin: 6px 0 0;
  color: #475569;
  font-size: 14px;
}

.crm-customer-notice-back,
.crm-customer-notice-actions button {
  display: inline-flex;
  min-height: 42px;
  padding: 9px 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid #334155;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none !important;
  cursor: pointer;
}

.crm-customer-notice-back {
  background: #f8fafc;
  color: #172033 !important;
  white-space: nowrap;
}

.crm-customer-notice-card,
.crm-customer-notice-history {
  margin-top: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.crm-customer-notice-summary {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(130px, .7fr) minmax(150px, .8fr);
  border-bottom: 1px solid #cbd5e1;
}

.crm-customer-notice-summary > div {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid #dbe3ec;
}

.crm-customer-notice-summary > div:last-child {
  border-right: 0;
}

.crm-customer-notice-summary span,
.crm-customer-notice-grid label > span {
  display: block;
  margin-bottom: 6px;
  color: #526071;
  font-size: 11px;
  font-weight: 800;
}

.crm-customer-notice-summary strong {
  display: block;
  overflow: hidden;
  color: #111827;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-customer-notice-summary strong.is-ready {
  color: #15803d;
}

.crm-customer-notice-form {
  padding: 18px;
}

.crm-customer-notice-grid {
  display: grid;
  grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr);
  gap: 14px;
}

.crm-customer-notice-grid input,
.crm-customer-notice-grid textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #94a3b8;
  border-radius: 5px;
  background: #fff;
  color: #111827;
  font-family: inherit;
  font-size: 15px;
}

.crm-customer-notice-grid input {
  min-height: 46px;
  padding: 10px 12px;
}

.crm-customer-notice-grid textarea {
  min-height: 116px;
  padding: 11px 12px;
  line-height: 1.5;
  resize: vertical;
}

.crm-customer-notice-grid input:focus,
.crm-customer-notice-grid textarea:focus {
  border-color: #2563eb;
  outline: 3px solid rgba(37, 99, 235, .15);
}

.crm-customer-notice-actions {
  display: flex;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.crm-customer-notice-actions button.is-whatsapp {
  border-color: #15803d;
  background: #15803d;
  color: #fff;
}

.crm-customer-notice-actions button.is-sms {
  border-color: #1d4ed8;
  background: #2563eb;
  color: #fff;
}

.crm-customer-notice-actions button.is-confirm {
  margin-left: auto;
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.crm-customer-notice-actions button:disabled {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
}

.crm-customer-notice-help,
.crm-customer-notice-empty {
  margin: 12px 0 0;
  color: #64748b;
  font-size: 12px;
}

.crm-customer-notice-status {
  margin-top: 14px;
  padding: 12px 15px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 700;
}

.crm-customer-notice-status.is-success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.crm-customer-notice-status.is-error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.crm-customer-notice-history {
  padding: 18px;
}

.crm-customer-notice-history h2 {
  margin: 0 0 12px;
  color: #111827;
  font-size: 17px;
}

.crm-customer-notice-table-wrap {
  overflow-x: auto;
  border: 1px solid #dbe3ec;
}

.crm-customer-notice-history table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}

.crm-customer-notice-history th,
.crm-customer-notice-history td {
  padding: 10px;
  border-right: 1px solid #dbe3ec;
  border-bottom: 1px solid #dbe3ec;
  text-align: left;
  vertical-align: top;
}

.crm-customer-notice-history th:last-child,
.crm-customer-notice-history td:last-child {
  border-right: 0;
}

.crm-customer-notice-history th {
  background: #edf2f7;
  color: #243044;
  font-size: 11px;
}

.crm-customer-notice-history tbody tr:nth-child(even) {
  background: #f8fafc;
}

@media (max-width: 700px) {
	.crm-assistenza-notification-status {
		grid-template-columns: 1fr;
	}

	.crm-assistenza-notification-status a {
		grid-column: 1;
		grid-row: auto;
		margin-top: 4px;
	}

  .crm-customer-notice-page {
    width: calc(100% - 16px);
    margin-top: 10px;
  }

  .crm-customer-notice-header {
    padding: 14px;
    align-items: stretch;
    flex-direction: column;
  }

  .crm-customer-notice-header h1 {
    font-size: 21px;
  }

  .crm-customer-notice-back {
    width: 100%;
    box-sizing: border-box;
  }

  .crm-customer-notice-summary,
  .crm-customer-notice-grid {
    grid-template-columns: 1fr;
  }

  .crm-customer-notice-summary > div {
    border-right: 0;
    border-bottom: 1px solid #dbe3ec;
  }

  .crm-customer-notice-summary > div:last-child {
    border-bottom: 0;
  }

  .crm-customer-notice-form,
  .crm-customer-notice-history {
    padding: 13px;
  }

  .crm-customer-notice-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .crm-customer-notice-actions button.is-confirm {
    grid-column: 1 / -1;
    margin-left: 0;
  }
}

.crm-agenda-toolbar {
  border: 1px solid #d7e1ee !important;
  border-radius: 8px;
  background: #ffffff !important;
  box-shadow: var(--crm-shadow);
  margin: 0 auto 14px;
  overflow: hidden;
}

.crm-agenda-toolbar td {
  padding: 8px 10px;
}

.crm-agenda-toolbar td[bgcolor="lightblue"],
.crm-agenda-toolbar td:first-child {
  background: #eef6ff !important;
  color: #16345c;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.crm-agenda-legend {
  border: 1px solid #d7e1ee !important;
  border-radius: 8px;
  box-shadow: var(--crm-shadow);
  overflow: hidden;
}

.crm-agenda-legend td {
  min-width: 110px;
  border-bottom: 0 !important;
  color: #172033 !important;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-align: center;
  text-transform: uppercase;
}

.crm-agenda-board {
  table-layout: fixed;
  border-color: #ccd8e6 !important;
  border-radius: 8px;
  background: #ffffff !important;
  box-shadow: var(--crm-shadow);
}

.crm-agenda-board > tbody > tr:first-child > td,
.crm-agenda-board > tr:first-child > td {
  background: #f0f5fb !important;
  color: #29384f !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: .04em !important;
  text-align: center;
  text-transform: uppercase;
}

.crm-agenda-board > tbody > tr:first-child > td[bgcolor="yellow"],
.crm-agenda-board > tr:first-child > td[bgcolor="yellow"],
.crm-agenda-today {
  background: #fef3c7 !important;
  border-left-color: #eab308 !important;
  color: #713f12 !important;
}

.crm-agenda-board > tbody > tr:nth-child(2) > td,
.crm-agenda-board > tr:nth-child(2) > td {
  background: #f8fafc !important;
  padding: 10px !important;
  vertical-align: top !important;
}

.crm-agenda-board > tbody > tr:last-child > td,
.crm-agenda-board > tr:last-child > td {
  background: #354154 !important;
  padding: 8px !important;
  text-align: center;
}

.crm-agenda-board > tbody > tr:last-child input[type="submit"],
.crm-agenda-board > tr:last-child input[type="submit"] {
  min-height: 30px;
  padding: 6px 12px;
}

.crm-page table.crm-agenda-card,
.crm-module-body table.crm-agenda-card {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-radius: 8px !important;
  box-shadow: 0 6px 14px rgba(23, 32, 51, .08);
  margin: 0 0 8px;
  overflow: hidden;
}

.crm-page table.crm-agenda-card td,
.crm-module-body table.crm-agenda-card td {
  border-bottom: 0 !important;
  padding: 8px 9px !important;
  text-align: left !important;
}

.crm-page table.crm-agenda-card b,
.crm-module-body table.crm-agenda-card b {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  margin-bottom: 4px;
}

.crm-page table.crm-agenda-card a,
.crm-module-body table.crm-agenda-card a {
  min-height: 24px;
  border: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, .7);
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 3px 6px;
}

.crm-page table.crm-agenda-card a.crm-agenda-link,
.crm-module-body table.crm-agenda-card a.crm-agenda-link {
  display: block;
  min-height: 52px;
  color: inherit;
  padding: 8px 9px;
  text-decoration: none;
}

.crm-page table.crm-agenda-card a.crm-agenda-link:hover,
.crm-module-body table.crm-agenda-card a.crm-agenda-link:hover {
  filter: brightness(.96);
}

.crm-page table.crm-agenda-card .crm-agenda-time,
.crm-module-body table.crm-agenda-card .crm-agenda-time {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 5px;
  background: rgba(255, 255, 255, .7);
  padding: 3px 6px;
}

.crm-page table.crm-agenda-card i,
.crm-module-body table.crm-agenda-card i {
  display: block;
  color: inherit;
  font-style: normal;
  font-weight: 700;
  line-height: 1.25;
}

.crm-agenda-done,
.crm-page table.crm-agenda-card.crm-agenda-done,
.crm-module-body table.crm-agenda-card.crm-agenda-done {
  background: #e5e7eb !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

.crm-agenda-missed,
.crm-page table.crm-agenda-card.crm-agenda-missed,
.crm-module-body table.crm-agenda-card.crm-agenda-missed {
  background: #ede9fe !important;
  border-color: #a78bfa !important;
  color: #4c1d95 !important;
}

.crm-agenda-virtual,
.crm-page table.crm-agenda-card.crm-agenda-virtual,
.crm-module-body table.crm-agenda-card.crm-agenda-virtual {
  background: #fce7f3 !important;
  border-color: #f9a8d4 !important;
  color: #831843 !important;
}

.crm-agenda-fixed,
.crm-page table.crm-agenda-card.crm-agenda-fixed,
.crm-module-body table.crm-agenda-card.crm-agenda-fixed {
  background: #dcfce7 !important;
  border-color: #86efac !important;
  color: #14532d !important;
}

.crm-agenda-locked,
.crm-page table.crm-agenda-card.crm-agenda-locked,
.crm-module-body table.crm-agenda-card.crm-agenda-locked {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
  color: #7f1d1d !important;
}

.crm-page table.crm-agenda-card.crm-agenda-done td,
.crm-module-body table.crm-agenda-card.crm-agenda-done td,
body.crm-page table[border="1"].crm-agenda-card td.crm-agenda-done,
body.crm-page table[border="1"].crm-agenda-card tr:first-child td.crm-agenda-done,
.crm-page table.crm-agenda-card.crm-agenda-done a.crm-agenda-link,
.crm-module-body table.crm-agenda-card.crm-agenda-done a.crm-agenda-link {
  background: #e5e7eb !important;
}

.crm-page table.crm-agenda-card.crm-agenda-missed td,
.crm-module-body table.crm-agenda-card.crm-agenda-missed td,
body.crm-page table[border="1"].crm-agenda-card td.crm-agenda-missed,
body.crm-page table[border="1"].crm-agenda-card tr:first-child td.crm-agenda-missed,
.crm-page table.crm-agenda-card.crm-agenda-missed a.crm-agenda-link,
.crm-module-body table.crm-agenda-card.crm-agenda-missed a.crm-agenda-link {
  background: #ede9fe !important;
}

.crm-page table.crm-agenda-card.crm-agenda-virtual td,
.crm-module-body table.crm-agenda-card.crm-agenda-virtual td,
body.crm-page table[border="1"].crm-agenda-card td.crm-agenda-virtual,
body.crm-page table[border="1"].crm-agenda-card tr:first-child td.crm-agenda-virtual,
.crm-page table.crm-agenda-card.crm-agenda-virtual a.crm-agenda-link,
.crm-module-body table.crm-agenda-card.crm-agenda-virtual a.crm-agenda-link {
  background: #fce7f3 !important;
}

.crm-page table.crm-agenda-card.crm-agenda-fixed td,
.crm-module-body table.crm-agenda-card.crm-agenda-fixed td,
body.crm-page table[border="1"].crm-agenda-card td.crm-agenda-fixed,
body.crm-page table[border="1"].crm-agenda-card tr:first-child td.crm-agenda-fixed,
.crm-page table.crm-agenda-card.crm-agenda-fixed a.crm-agenda-link,
.crm-module-body table.crm-agenda-card.crm-agenda-fixed a.crm-agenda-link {
  background: #dcfce7 !important;
}

.crm-page table.crm-agenda-card.crm-agenda-locked td,
.crm-module-body table.crm-agenda-card.crm-agenda-locked td,
body.crm-page table[border="1"].crm-agenda-card td.crm-agenda-locked,
body.crm-page table[border="1"].crm-agenda-card tr:first-child td.crm-agenda-locked,
.crm-page table.crm-agenda-card.crm-agenda-locked a.crm-agenda-link,
.crm-module-body table.crm-agenda-card.crm-agenda-locked a.crm-agenda-link {
  background: #fee2e2 !important;
}

.crm-page table.crm-agenda-legend td.crm-agenda-today,
.crm-module-body table.crm-agenda-legend td.crm-agenda-today {
  background: #fef3c7 !important;
  color: #713f12 !important;
}

.crm-page table.crm-agenda-legend td.crm-agenda-done,
.crm-module-body table.crm-agenda-legend td.crm-agenda-done {
  background: #e5e7eb !important;
  color: #475569 !important;
}

.crm-page table.crm-agenda-legend td.crm-agenda-missed,
.crm-module-body table.crm-agenda-legend td.crm-agenda-missed {
  background: #ede9fe !important;
  color: #4c1d95 !important;
}

.crm-page table.crm-agenda-legend td.crm-agenda-virtual,
.crm-module-body table.crm-agenda-legend td.crm-agenda-virtual {
  background: #fce7f3 !important;
  color: #831843 !important;
}

.crm-page table.crm-agenda-legend td.crm-agenda-fixed,
.crm-module-body table.crm-agenda-legend td.crm-agenda-fixed {
  background: #dcfce7 !important;
  color: #14532d !important;
}

.crm-page table.crm-agenda-legend td.crm-agenda-locked,
.crm-module-body table.crm-agenda-legend td.crm-agenda-locked {
  background: #fee2e2 !important;
  color: #7f1d1d !important;
}

/* Agenda personale: griglia responsive con stati cromatici invariati. */
.crm-agenda-page {
  width: 100%;
  margin: 0 auto 26px;
  color: #172033;
}

.crm-agenda-page .crm-agenda-toolbar {
  width: 100%;
  min-height: 72px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 12px;
  border: 1px solid #b9c8d9 !important;
  border-radius: 8px;
  background: #ffffff !important;
  box-shadow: 0 4px 14px rgba(23, 32, 51, .09);
  padding: 10px 12px;
}

.crm-agenda-heading {
  min-width: 190px;
  padding: 0 8px;
}

.crm-agenda-heading span,
.crm-agenda-week-header span {
  display: block;
  margin: 0 0 2px;
  color: #46617f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}

.crm-agenda-heading h1 {
  margin: 0;
  color: #16345c;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: none;
}

.crm-agenda-user-control {
  min-width: 210px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-agenda-user-control label {
  color: #44566c;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.crm-agenda-user-control select {
  width: 100%;
  min-width: 145px;
  min-height: 38px;
  border: 1px solid #aebed0;
  border-radius: 6px;
  background: #ffffff;
  color: #172033;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 30px 6px 10px;
}

.crm-agenda-navigation {
  display: grid;
  grid-template-columns: 40px 76px 40px;
  gap: 6px;
  margin-left: auto;
}

.crm-agenda-page .crm-agenda-navigation button,
.crm-agenda-page .crm-agenda-legend-button {
  min-height: 38px;
  margin: 0;
  border: 1px solid #174ea6;
  border-radius: 6px;
  background: #1d5fd1;
  color: #ffffff;
  box-shadow: none;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
}

.crm-agenda-page .crm-agenda-navigation button:hover,
.crm-agenda-page .crm-agenda-legend-button:hover {
  background: #174ea6;
}

.crm-agenda-page .crm-agenda-navigation .crm-agenda-nav-arrow {
  font-size: 24px;
  line-height: 1;
  padding: 0;
}

.crm-agenda-page .crm-agenda-legend-button {
  min-width: 138px;
  padding: 7px 12px;
}

.crm-agenda-page .crm-agenda-legend {
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 12px;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.crm-agenda-page .crm-agenda-legend > span {
  min-width: 112px;
  box-sizing: border-box;
  border: 1px solid;
  border-radius: 5px;
  color: #172033;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
  padding: 7px 10px;
  text-align: center;
}

.crm-agenda-week {
  margin: 0 0 16px;
  border: 1px solid #b9c8d9;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(23, 32, 51, .08);
  overflow: hidden;
}

.crm-agenda-week-header {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #b9c8d9;
  background: #eef3f8;
  padding: 8px 14px;
}

.crm-agenda-week-header h2 {
  margin: 0;
  color: #1e334d;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.crm-agenda-week-header > strong {
  border: 1px solid #aebed0;
  border-radius: 5px;
  background: #ffffff;
  color: #334b68;
  font-size: 11px;
  padding: 6px 9px;
  white-space: nowrap;
}

.crm-agenda-week-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
}

.crm-agenda-day {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #cbd6e2;
  background: #ffffff;
}

.crm-agenda-day:last-child {
  border-right: 0;
}

.crm-agenda-day.is-today {
  background: #fffcf0;
}

.crm-agenda-day-header {
  min-height: 48px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 1px solid #cbd6e2;
  background: #dfe8f2;
  color: #24364d;
  padding: 8px 6px;
  text-align: center;
}

.crm-agenda-day-header span {
  color: #3e5875;
  font-size: 11px;
  font-weight: 900;
}

.crm-agenda-day-header strong {
  font-size: 12px;
  white-space: nowrap;
}

.crm-agenda-day.is-today .crm-agenda-day-header {
  background: #fef3c7;
  color: #713f12;
}

.crm-agenda-day-events {
  min-height: 156px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.crm-agenda-empty {
  display: flex;
  min-height: 64px;
  flex: 1;
  align-items: center;
  justify-content: center;
  color: #6b7c91;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.crm-agenda-page a.crm-agenda-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid !important;
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(23, 32, 51, .08);
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  padding: 9px 10px;
  text-align: left;
  text-decoration: none;
  transition: box-shadow .16s ease, transform .16s ease;
}

.crm-agenda-page a.crm-agenda-card:hover {
  box-shadow: 0 6px 13px rgba(23, 32, 51, .15);
  transform: translateY(-1px);
}

.crm-agenda-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.crm-agenda-page .crm-agenda-time {
  min-height: auto;
  display: inline-block;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, .72);
  color: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 3px 5px;
}

.crm-agenda-status {
  min-width: 0;
  color: inherit;
  font-size: 9px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.crm-agenda-page a.crm-agenda-card > strong {
  display: block;
  margin: 1px 0 0;
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.crm-agenda-subject {
  display: block;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.crm-agenda-duration {
  display: block;
  margin-top: 2px;
  border-top: 1px solid rgba(23, 32, 51, .16);
  color: inherit;
  font-size: 10px;
  font-weight: 900;
  padding-top: 5px;
}

.crm-agenda-page a.crm-agenda-card.crm-agenda-done {
  background: #e5e7eb !important;
  border-color: #a8b1bd !important;
  color: #38485c !important;
}

.crm-agenda-page a.crm-agenda-card.crm-agenda-missed {
  background: #e8ddfb !important;
  border-color: #9b79dd !important;
  color: #3f1f72 !important;
}

.crm-agenda-page a.crm-agenda-card.crm-agenda-fixed {
  background: #c9f4d6 !important;
  border-color: #55b977 !important;
  color: #124427 !important;
}

.crm-agenda-page a.crm-agenda-card.crm-agenda-locked {
  background: #ffd7d7 !important;
  border-color: #e35656 !important;
  color: #701d1d !important;
}

.crm-agenda-add-form {
  margin: 0;
  border-top: 1px solid #cbd6e2;
  background: #eef3f8;
  padding: 8px;
  text-align: center;
}

.crm-agenda-page .crm-agenda-add-form button {
  width: 100%;
  min-height: 34px;
  margin: 0;
  border: 1px solid #aebed0;
  border-radius: 5px;
  background: #ffffff;
  color: #174ea6;
  box-shadow: none;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
}

.crm-agenda-page .crm-agenda-add-form button span {
  display: inline-block;
  margin-right: 3px;
  font-size: 17px;
  line-height: 1;
  vertical-align: -1px;
}

.crm-agenda-page .crm-agenda-add-form button:hover {
  border-color: #1d5fd1;
  background: #eaf2ff;
}

@media (max-width: 1100px) {
  .crm-agenda-page .crm-agenda-toolbar {
    flex-wrap: wrap;
  }

  .crm-agenda-navigation {
    margin-left: 0;
  }

  .crm-agenda-week-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .crm-agenda-day {
    border-bottom: 1px solid #cbd6e2;
  }

  .crm-agenda-day:nth-child(3n) {
    border-right: 0;
  }

  .crm-agenda-day:nth-child(n+4) {
    border-bottom: 0;
  }
}

@media (max-width: 700px) {
  .crm-agenda-page .crm-agenda-toolbar {
    align-items: stretch;
    gap: 10px;
    padding: 11px;
  }

  .crm-agenda-heading,
  .crm-agenda-user-control,
  .crm-agenda-navigation,
  .crm-agenda-page .crm-agenda-legend-button {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .crm-agenda-heading {
    padding: 0;
  }

  .crm-agenda-user-control {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }

  .crm-agenda-navigation {
    grid-template-columns: 44px 1fr 44px;
  }

  .crm-agenda-page .crm-agenda-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .crm-agenda-page .crm-agenda-legend > span {
    min-width: 0;
  }

  .crm-agenda-week-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .crm-agenda-week-grid {
    grid-template-columns: 1fr;
  }

  .crm-agenda-day,
  .crm-agenda-day:nth-child(3n),
  .crm-agenda-day:nth-child(n+4) {
    border-right: 0;
    border-bottom: 1px solid #cbd6e2;
  }

  .crm-agenda-day:last-child {
    border-bottom: 0;
  }

  .crm-agenda-day-header {
    justify-content: flex-start;
    padding-left: 12px;
  }

  .crm-agenda-day-events {
    min-height: 72px;
  }
}

.crm-work-sheet {
  width: min(1180px, 100%);
  margin: 0 auto 28px;
  color: var(--crm-text);
}

.crm-work-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--crm-shadow);
  padding: 16px;
}

.crm-work-sheet h1,
.crm-work-sheet h2 {
  margin: 0;
  letter-spacing: 0;
}

.crm-work-sheet h1 {
  font-size: 24px;
  line-height: 1.15;
}

.crm-work-sheet h2 {
  margin-bottom: 12px;
  color: #243247;
  font-size: 16px;
}

.crm-work-sheet-header p {
  margin: 6px 0 0;
  color: var(--crm-muted);
  font-weight: 700;
}

.crm-work-section,
.crm-work-sheet-saved {
  margin: 0 0 14px;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--crm-shadow);
  padding: 16px;
}

.crm-work-sheet-saved {
  border-color: #86efac;
  background: #dcfce7;
  color: #14532d;
  font-weight: 900;
}

.crm-work-sheet-contract {
  margin: 0 0 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  box-shadow: var(--crm-shadow);
  color: #1e3a8a;
  font-weight: 800;
  padding: 14px 16px;
}

.crm-work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.crm-work-sheet label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--crm-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.crm-work-sheet input[type="text"],
.crm-work-sheet input[type="time"],
.crm-work-sheet input[type="date"],
.crm-work-sheet input[type="file"],
.crm-work-sheet input[type="number"],
.crm-work-sheet select,
.crm-work-sheet textarea {
  width: 100%;
  color: var(--crm-text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.crm-work-sheet textarea {
  min-height: 110px;
  resize: vertical;
}

.crm-signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.crm-signature-box {
  min-width: 0;
}

.crm-signature-box canvas {
  display: block;
  width: 100%;
  height: 190px;
  margin: 8px 0 10px;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  touch-action: none;
  cursor: crosshair;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.crm-signature-box canvas.crm-signature-pending {
  border-color: #f59e0b;
  background: #fffbeb;
}

.crm-signature-box canvas.crm-signature-locked {
  border-color: #22c55e;
  background: #f0fdf4;
  cursor: not-allowed;
}

.crm-signature-status {
  min-height: 18px;
  margin: -2px 0 8px;
  color: #64748b;
  font-size: 12px;
  line-height: 18px;
}

.crm-signature-box button {
  width: 100%;
  margin-top: 8px;
  background: #eef2f7;
  color: #334155;
  box-shadow: none;
}

.crm-signature-box button.crm-signature-approve {
  display: none;
  background: #16a34a;
  color: #ffffff;
}

.crm-signature-box button.crm-signature-approve:hover {
  background: #15803d;
  color: #ffffff;
}

.crm-signature-box button:hover {
  background: #dbe4ef;
  color: #1f2937;
}

.crm-work-submit {
  display: flex;
  justify-content: flex-end;
  margin: 14px 0 0;
}

.crm-work-submit input[type="submit"] {
  min-width: 180px;
}

.crm-contract-page {
  max-width: 1280px;
}

.crm-contract-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
}

.crm-contract-button-primary {
  border-color: #1d4ed8;
  background: #2563eb;
  color: #ffffff;
}

.crm-contract-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 0;
}

.crm-contract-toolbar label {
  flex: 1 1 320px;
  max-width: 520px;
}

.crm-contract-toolbar input[type="submit"] {
  min-width: 120px;
  min-height: 38px;
}

.crm-contract-table-wrap {
  overflow-x: auto;
}

.crm-contract-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--crm-text);
  font-size: 13px;
  text-align: left;
}

.crm-contract-table th {
  border-bottom: 1px solid #cbd5e1;
  background: #eef2f7;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  padding: 10px 12px;
  text-transform: uppercase;
  white-space: nowrap;
}

.crm-contract-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 11px 12px;
  vertical-align: middle;
}

.crm-contract-table tbody tr:nth-child(even) td {
  background: #d9ecff !important;
}

.crm-contract-table tbody tr:hover td {
  background: #bfdbfe !important;
}

.crm-sottoscorta-scroll {
  max-height: 68vh;
  overflow: auto;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
}

.crm-sottoscorta-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  box-shadow: 0 2px 0 rgba(15, 23, 42, 0.08);
}

.crm-sottoscorta-code-link {
  display: inline !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #1d4ed8 !important;
  padding: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.crm-sottoscorta-code-link:hover {
  color: #2563eb !important;
  text-decoration: underline !important;
}

.crm-sottoscorta-current {
  display: inline-block;
  min-width: 42px;
}

.crm-sottoscorta-new-stock {
  width: 4ch;
  min-width: 4ch;
  max-width: 4ch;
  min-height: 24px;
  margin-left: 2px;
  padding: 2px 1px;
  font-size: 11px;
  text-align: right;
}

.crm-quaderno-toggle {
  min-height: 30px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: none;
  font-size: 12px;
  padding: 6px 10px;
}

.crm-quaderno-toggle:hover {
  background: #dbeafe;
  color: #1e40af;
}

.crm-quaderno-page {
  background-color: #e9e4db;
  background-image:
    linear-gradient(rgba(255, 255, 255, .34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .3) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid #b8c5cf;
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(28, 48, 66, .12);
}

.crm-quaderno-page .crm-work-sheet-header,
.crm-quaderno-page .crm-quaderno-new-note,
.crm-quaderno-page .crm-quaderno-list-section {
  border: 1px solid #b8c5cf;
  background: rgba(255, 255, 255, .96);
}

.crm-quaderno-editor {
  min-height: 288px !important;
  resize: vertical;
  border: 1px solid #9fb0bc !important;
  border-radius: 4px !important;
  padding: 13px 15px !important;
  background-color: #fbfaf5 !important;
  background-image:
    linear-gradient(rgba(157, 174, 184, .28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157, 174, 184, .23) 1px, transparent 1px) !important;
  background-size: 24px 24px !important;
  background-attachment: local !important;
  color: #223541 !important;
  font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif !important;
  font-size: 14px !important;
  line-height: 24px !important;
  caret-color: #174b6b;
}

.crm-quaderno-editor:focus {
  outline: 0;
  border-color: #287a62 !important;
  box-shadow: 0 0 0 3px rgba(40, 122, 98, .14) !important;
}

.crm-quaderno-page .crm-work-sheet-header {
  border-radius: 5px;
  padding: 14px 16px;
}

.crm-quaderno-list-section {
  overflow-x: auto;
  border-radius: 5px;
  padding: 0 !important;
}

.crm-quaderno-list-section > h2 {
  position: sticky;
  left: 0;
  margin: 0;
  border-bottom: 1px solid #aebcc6;
  padding: 12px 14px;
  background: #edf2f4;
  color: #29485e;
  font-size: 15px;
}

.crm-quaderno-table {
  width: 100%;
  margin: 0 !important;
  border: 0 !important;
  border-collapse: collapse !important;
  table-layout: fixed;
}

.crm-quaderno-open-table { min-width: 1040px; }
.crm-quaderno-archive-table { min-width: 880px; }

.crm-quaderno-table th,
.crm-quaderno-table td {
  border-right: 1px solid #c7d2da !important;
  border-bottom: 1px solid #c7d2da !important;
  padding: 9px 10px !important;
  vertical-align: middle !important;
}

.crm-quaderno-table th:last-child,
.crm-quaderno-table td:last-child {
  border-right: 0 !important;
}

.crm-quaderno-table thead th {
  background: #dce6eb !important;
  color: #243f52 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-align: center !important;
  text-transform: uppercase;
}

.crm-quaderno-table .crm-quaderno-main-row td {
  background: #fff !important;
  color: #243442;
  font-size: 12px;
}

.crm-quaderno-table .crm-quaderno-main-row.is-alt td {
  background: #edf4f8 !important;
}

.crm-quaderno-table .crm-quaderno-main-row:hover td,
.crm-quaderno-table .crm-quaderno-main-row.is-alt:hover td {
  background: #dfeceb !important;
}

.crm-quaderno-table .crm-quaderno-content-row td {
  border: 1px solid #9eb0bd !important;
  padding: 16px !important;
  background-color: #f7f5ef !important;
  background-image:
    linear-gradient(rgba(177, 190, 198, .23) 1px, transparent 1px),
    linear-gradient(90deg, rgba(177, 190, 198, .2) 1px, transparent 1px) !important;
  background-size: 24px 24px !important;
  color: #223541;
  font-size: 13px;
  line-height: 1.55;
}

.crm-quaderno-content-cell {
  white-space: pre-wrap;
}

.crm-quaderno-open-table th:nth-child(1) { width: 13%; }
.crm-quaderno-open-table th:nth-child(2) { width: 19%; }
.crm-quaderno-open-table th:nth-child(3) { width: 15%; }
.crm-quaderno-open-table th:nth-child(4) { width: 10%; }
.crm-quaderno-open-table th:nth-child(5) { width: 12%; }
.crm-quaderno-open-table th:nth-child(6) { width: 13%; }
.crm-quaderno-open-table th:nth-child(7) { width: 18%; }

@media (max-width: 760px) {
  .crm-quaderno-page {
    border-radius: 0;
    padding: 10px;
  }
  .crm-quaderno-page .crm-work-sheet-header {
    padding: 12px;
  }
}

.crm-contract-client {
  min-width: 190px;
  font-weight: 900;
}

.crm-contract-client a,
.crm-contract-link {
  color: #1d4ed8;
  font-weight: 900;
  text-decoration: none;
}

.crm-contract-email {
  min-width: 260px;
  color: #475569;
  font-size: 12px;
  white-space: nowrap !important;
}

.crm-contract-phone {
  min-width: 145px;
  color: #475569;
  font-size: 12px;
  white-space: nowrap !important;
}

.crm-contract-money {
  font-weight: 900;
  white-space: nowrap;
}

.crm-contract-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.crm-contract-pill-ok {
  background: #dcfce7;
  color: #166534;
}

.crm-contract-pill-no {
  background: #fee2e2;
  color: #991b1b;
}

.crm-contract-empty {
  color: var(--crm-muted);
  font-weight: 800;
  padding: 24px !important;
  text-align: center;
}

.crm-contract-file {
  min-height: 38px;
  border: 1px solid #d7dde7;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 10px 12px;
  text-transform: none;
}

.crm-contract-file input[type="checkbox"] {
  margin: 10px 7px 0 0;
}

.crm-contract-document-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.crm-contract-scan-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  border: 1px solid #1d4ed8;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 900;
  padding: 0 9px;
  text-decoration: none;
}

.crm-contract-scan-page { max-width: 1060px; }
.crm-contract-scan-summary strong { font-size: 15px; }
.crm-contract-scan-help { margin: 0 0 15px; color: #526273; }
.crm-contract-scan-warning,
.crm-contract-scan-notice {
  margin: 0 0 14px;
  border: 1px solid #d97706;
  border-radius: 7px;
  background: #fff7ed;
  color: #7c2d12;
  font-weight: 800;
  padding: 12px 14px;
}
.crm-contract-scan-notice.is-ok { border-color: #58a67b; background: #effbf4; color: #175f39; }
.crm-contract-scan-notice.is-error { border-color: #dc6b6b; background: #fef2f2; color: #8a1c1c; }
.crm-contract-scan-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-top: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  padding: 0 12px;
}
.crm-contract-scan-check input { width: 22px !important; height: 22px; margin: 0 !important; }
.crm-contract-scan-check span { font-weight: 800; }
.crm-contract-scan-submit { margin-bottom: 14px; }
.crm-contract-scan-submit button { min-width: 220px; }
.crm-contract-scan-loading {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .78);
  color: #fff;
  text-align: center;
}
.crm-contract-scan-loading span {
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border: 4px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: crm-contract-scan-spin .8s linear infinite;
}
.crm-contract-scan-loading strong { font-size: 21px; }
.crm-contract-scan-loading small { max-width: 420px; margin-top: 8px; font-size: 13px; }
@keyframes crm-contract-scan-spin { to { transform: rotate(360deg); } }

.crm-contract-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.crm-contract-summary div {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.crm-contract-summary strong {
  display: block;
  color: #111827;
  font-size: 18px;
  line-height: 1.1;
}

.crm-contract-summary span {
  display: block;
  margin-top: 5px;
  color: var(--crm-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.crm-contract-options {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.crm-contract-options label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  color: #334155;
  font-size: 13px;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.crm-contract-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.crm-ordfor-date-field {
  min-width: 190px;
}

.crm-ordfor-date-field input[type="date"] {
  min-width: 170px;
}

.crm-ordfor-product-field {
  max-width: 420px;
}

.crm-ordfor-suggest {
  display: none;
  position: absolute;
  z-index: 30;
  width: min(620px, calc(100vw - 44px));
  max-height: 320px;
  overflow: auto;
  margin-top: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .18);
}

.crm-ordfor-item {
  display: grid;
  width: 100%;
  gap: 3px;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  padding: 10px 12px;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.crm-ordfor-item:hover,
.crm-ordfor-item:focus {
  background: #eaf6ff;
  outline: 0;
}

.crm-ordfor-item b {
  font-size: 12px;
  color: #0f3f6d;
}

.crm-ordfor-item span {
  font-size: 13px;
  line-height: 1.3;
}

.crm-ordfor-item small,
.crm-ordfor-empty {
  color: #64748b;
  font-size: 12px;
}

.crm-ordfor-stock {
  display: inline-flex;
  gap: 5px;
  margin-right: 8px;
  vertical-align: middle;
}

.crm-ordfor-stock i {
  display: inline-block;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  background: #eff6ff;
  padding: 1px 5px;
  color: #0f3f6d;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.crm-ordfor-empty {
  padding: 12px;
}

.crm-preventivi-toolbar {
  border: 1px solid #dbe3ed !important;
  border-radius: 8px;
  background: #f8fafc !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.crm-preventivi-toolbar td {
  background: transparent !important;
  color: #334155;
}

.crm-preventivi-table {
  border: 1px solid #dbe3ed !important;
  border-radius: 8px;
  border-collapse: separate !important;
  border-spacing: 0;
  overflow: hidden;
  background: #fff !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .07);
}

.crm-preventivi-table tr:first-child td {
  background: #f1f5f9 !important;
  color: #475569;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

body.crm-page table.crm-preventivi-table > tbody > tr > td {
  border: 0 !important;
  border-right: 1px solid #d7dee8 !important;
  border-bottom: 1px solid #e5eaf1 !important;
  padding: 9px 10px;
  background: #fff !important;
  color: #1f2937;
  vertical-align: middle;
}

body.crm-page table.crm-preventivi-table > tbody > tr > td:last-child {
  border-right: 0 !important;
}

body.crm-page table.crm-preventivi-table > tbody > tr:first-child > td {
  border-right-color: #c5d0de !important;
  border-bottom-color: #c5d0de !important;
  font-weight: 700;
}

body.crm-page table.crm-preventivi-table > tbody > tr:last-child > td {
  border-bottom: 0 !important;
}

.crm-preventivi-table tr:nth-child(odd):not(:first-child) td {
  background: #f8fbfd !important;
}

.crm-preventivi-table tr:hover:not(:first-child) td {
  background: #edf6ff !important;
}

.crm-preventivi-table .crm-preventivi-client a {
  display: inline;
  min-height: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  padding: 0;
  color: #0f3f6d !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.crm-preventivi-table .crm-preventivi-client a:hover {
  color: var(--crm-primary-dark) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.crm-preventivi-table a[href*="visualizza.php"],
.crm-preventivi-table a[href*="download.php"] {
  display: inline-block;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  padding: 4px 8px;
  color: #1f2a3d;
  font-size: 12px;
  text-decoration: none;
}

.crm-mr-table tr:not(:first-child) a[href*="vedi.php"],
.crm-mr-table tr:not(:first-child) a[href*="mod.php"] {
  display: inline;
  min-height: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  padding: 0;
  color: #0f3f6d !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.crm-mr-table tr:not(:first-child) a[href*="vedi.php"]:hover,
.crm-mr-table tr:not(:first-child) a[href*="mod.php"]:hover {
  color: var(--crm-primary-dark) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 760px) {
  body.crm-page {
    padding: 10px;
  }

  .crm-work-sheet-header {
    display: block;
  }

  .crm-work-sheet-actions {
    margin-top: 12px;
  }

  .crm-work-grid,
  .crm-signature-grid {
    grid-template-columns: 1fr;
  }

  .crm-work-section {
    padding: 12px;
  }

  .crm-signature-box canvas {
    height: 220px;
  }

  .crm-work-submit {
    display: block;
  }

  .crm-work-submit input[type="submit"] {
    width: 100%;
  }

  .crm-contract-toolbar {
    display: block;
  }

  .crm-contract-toolbar input[type="submit"] {
    width: 100%;
    margin-top: 10px;
  }

  .crm-contract-summary {
    grid-template-columns: 1fr;
  }
}

/* RMA */
.crm-rma-page {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 16px 18px;
  box-sizing: border-box;
  color: #1e2b38;
  font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
  font-size: 15px;
}

.crm-rma-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 16px;
  padding: 4px 0 13px;
  border-bottom: 2px solid #2d5875;
}

.crm-rma-header h1 {
  margin: 0;
  color: #173c55;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0;
}

.crm-rma-header p {
  margin: 5px 0 0;
  color: #526474;
  font-size: 14px;
  font-weight: 700;
}

.crm-rma-actions,
.crm-rma-bottom-actions,
.crm-rma-form-actions,
.crm-rma-return {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.crm-rma-actions a,
.crm-rma-bottom-actions a,
.crm-rma-bottom-actions input[type="submit"],
.crm-rma-form-actions input[type="submit"],
.crm-rma-return a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid #8ba0b2;
  border-radius: 4px;
  padding: 8px 14px;
  background: #fff;
  color: #23465e !important;
  font-family: inherit;
  font-size: 13px !important;
  font-weight: 900;
  text-decoration: none !important;
}

.crm-rma-actions a.is-primary,
.crm-rma-form-actions input[type="submit"] {
  border-color: #174e70;
  background: #1f628d;
  color: #fff !important;
}

.crm-rma-actions a:hover,
.crm-rma-bottom-actions a:hover,
.crm-rma-return a:hover {
  border-color: #1f628d;
  background: #edf5fa;
}

.crm-rma-filter {
  margin-bottom: 18px;
  border: 1px solid #b8c7d3;
  border-radius: 5px;
  padding: 14px;
  background: #f4f7f9;
}

.crm-rma-filter-grid {
  display: grid;
  grid-template-columns: 90px 145px minmax(200px, 1.2fr) minmax(190px, 1fr) minmax(175px, .8fr) auto auto;
  align-items: end;
  gap: 11px;
}

.crm-rma-filter label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.crm-rma-filter label > span {
  color: #344b5d;
  font-size: 12px;
  font-weight: 900;
}

.crm-rma-filter input[type="text"],
.crm-rma-filter select,
.crm-rma-filter button {
  width: 100%;
  min-width: 0;
  height: 42px;
  box-sizing: border-box;
  border: 1px solid #8fa5b6;
  border-radius: 4px;
  padding: 7px 10px;
  background: #fff;
  color: #182d3d;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
}

.crm-rma-filter button {
  width: auto;
  min-width: 105px;
  border-color: #174e70;
  background: #1f628d;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.crm-rma-filter .crm-rma-archive {
  min-height: 42px;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.crm-rma-archive input[type="checkbox"] {
  width: 21px;
  height: 21px;
  margin: 0;
}

.crm-rma-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
}

.crm-rma-section-title h2 {
  margin: 0;
  color: #213e52;
  font-size: 16px;
  letter-spacing: 0;
}

.crm-rma-table-wrap {
  max-height: 64vh;
  overflow: auto;
  border: 1px solid #9eafbd;
  border-radius: 4px;
  background: #fff;
}

.crm-rma-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.crm-rma-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 46px;
  box-sizing: border-box;
  border-right: 1px solid #6f899b;
  border-bottom: 1px solid #6f899b;
  padding: 7px 8px;
  background: #315b76;
  color: #fff;
  text-align: center;
  vertical-align: middle;
  font-size: 12px;
  font-weight: 900;
}

.crm-rma-table th:last-child,
.crm-rma-table td:last-child { border-right: 0; }

.crm-rma-table th a {
  display: inline !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
  text-decoration: none;
}

.crm-rma-table td {
  box-sizing: border-box;
  border-right: 1px solid #c1ccd5;
  border-bottom: 1px solid #c1ccd5;
  padding: 10px 8px;
  color: #233542;
  text-align: center;
  vertical-align: middle;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.crm-rma-table tbody tr:nth-child(even) td { background-color: rgba(238, 244, 248, .58); }
.crm-rma-table tbody tr:hover td { background-color: #e7f1f7; }
.crm-rma-table tbody tr:last-child td { border-bottom: 0; }

.crm-rma-table th:nth-child(1) { width: 5%; }
.crm-rma-table th:nth-child(2) { width: 17%; }
.crm-rma-table th:nth-child(3) { width: 9%; }
.crm-rma-table th:nth-child(4) { width: 7%; }
.crm-rma-table th:nth-child(5) { width: 9%; }
.crm-rma-table th:nth-child(6) { width: 12%; }
.crm-rma-table th:nth-child(7) { width: 19%; }
.crm-rma-table th:nth-child(8) { width: 9%; }
.crm-rma-table th:nth-child(9) { width: 6%; }
.crm-rma-table th:nth-child(10) { width: 7%; }

.crm-rma-table .crm-rma-client,
.crm-rma-table td:nth-child(7) {
  text-align: left;
}

.crm-rma-table .crm-rma-client,
.crm-rma-table .crm-rma-client a {
  color: #163f5a;
  font-size: 15px !important;
  font-weight: 900;
  line-height: 1.4;
}

.crm-rma-table .crm-rma-client a,
.crm-rma-table td:nth-child(7) a {
  display: inline !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: underline !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: 2px;
}

.crm-rma-id {
  border-left: 5px solid #7c94a5;
  font-size: 15px !important;
  font-weight: 900 !important;
}

.crm-rma-status {
  display: inline-block;
  border: 1px solid #8ca2b2;
  border-radius: 3px;
  padding: 5px 7px;
  background: rgba(255,255,255,.74);
  color: #24465c !important;
  font-size: 13px !important;
  font-weight: 900;
  text-decoration: none;
}

.crm-rma-table tr.is-entry .crm-rma-id { border-left-color: #c35369; }
.crm-rma-table tr.is-working .crm-rma-id { border-left-color: #4c70a8; }
.crm-rma-table tr.is-waiting .crm-rma-id { border-left-color: #b73a3a; }
.crm-rma-table tr.is-assigned .crm-rma-id { border-left-color: #c28d1d; }
.crm-rma-table tr.is-shipped .crm-rma-id,
.crm-rma-table tr.is-sos .crm-rma-id { border-left-color: #d06c26; }
.crm-rma-table tr.is-received .crm-rma-id { border-left-color: #278354; }
.crm-rma-table tr.is-closed .crm-rma-id { border-left-color: #82909a; }

.crm-rma-table tr.is-entry td { background-color: #fff3f5; }
.crm-rma-table tr.is-working td { background-color: #eef4ff; }
.crm-rma-table tr.is-waiting td { background-color: #fff0f0; }
.crm-rma-table tr.is-assigned td { background-color: #fff8df; }
.crm-rma-table tr.is-shipped td,
.crm-rma-table tr.is-sos td { background-color: #fff3e9; }
.crm-rma-table tr.is-received td { background-color: #edf8f1; }
.crm-rma-table tr.is-closed td { background-color: #f4f6f7; color: #586771; }

.crm-rma-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 13px;
  border: 1px solid #a8b9c6;
  border-radius: 4px;
  background: #f3f7f9;
}

.crm-rma-summary > div {
  min-width: 0;
  border-right: 1px solid #bdcad3;
  padding: 11px 13px;
  text-align: center;
}

.crm-rma-summary > div:last-child { border-right: 0; }
.crm-rma-summary span { display: block; color: #526575; font-size: 11px; font-weight: 900; }
.crm-rma-summary strong { display: block; margin-top: 4px; color: #173f59; font-size: 17px; }

.crm-rma-detail-table,
.crm-rma-form-table {
  width: 100%;
  margin: 0 0 14px;
  border: 1px solid #a9bac7;
  border-collapse: collapse;
  background: #fff;
}

.crm-rma-save-notice {
  margin: 0 0 12px;
  border: 1px solid #6da17b;
  border-left: 5px solid #2f7b49;
  border-radius: 4px;
  padding: 11px 13px;
  background: #edf8f0;
  color: #245d37;
  font-size: 14px;
  font-weight: 900;
}

.crm-rma-detail-table td,
.crm-rma-form-table td {
  border: 1px solid #c4cfd7;
  padding: 11px 13px;
  color: #233746;
  vertical-align: middle;
  font-size: 15px;
  line-height: 1.4;
}

.crm-rma-detail-table td:nth-child(1),
.crm-rma-detail-table td:nth-child(4),
.crm-rma-form-table td:first-child {
  width: 17%;
  background: #edf3f6;
  color: #29495e;
  font-size: 13px;
  font-weight: 900;
}

.crm-rma-detail-table td:nth-child(3) {
  width: 3%;
  border-top: 0;
  border-bottom: 0;
  background: #fff;
}

.crm-rma-work-table td:nth-child(1) { width: 17%; }
.crm-rma-work-table td:nth-child(2) { width: auto; }
.crm-rma-work-table td:nth-child(3) { display: none; }

.crm-rma-detail-table textarea,
.crm-rma-form-table textarea {
  width: 100%;
  min-height: 120px;
  box-sizing: border-box;
  border: 1px solid #93a8b8;
  border-radius: 3px;
  padding: 10px;
  background: #fff;
  color: #172c3a;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  resize: vertical;
}

.crm-rma-cost-table {
  width: 100%;
  border: 1px solid #9fb1bf;
  border-collapse: collapse;
  background: #fff;
}

.crm-rma-cost-table th {
  padding: 9px 10px;
  background: #315b76;
  color: #fff;
  text-align: left;
  font-size: 13px;
}

.crm-rma-cost-table th:last-child,
.crm-rma-cost-table td:last-child { text-align: right; }
.crm-rma-cost-table td { border: 1px solid #c4cfd7; padding: 9px 10px; font-size: 14px; }

.crm-rma-bottom-actions {
  margin: 14px 0;
  padding: 12px 0;
  border-top: 1px solid #c2cdd5;
  border-bottom: 1px solid #c2cdd5;
}

.crm-rma-bottom-actions form { margin: 0; }
.crm-rma-bottom-actions .is-danger { margin-left: auto; }
.crm-rma-bottom-actions .is-danger input[type="submit"] { border-color: #b34d4d; color: #8f2424 !important; }

.crm-rma-edit-form {
  margin: 0;
  overflow-x: auto;
}

.crm-rma-form-table td:first-child { min-width: 190px; }

.crm-rma-form-table input[type="text"],
.crm-rma-form-table select {
  min-height: 39px;
  box-sizing: border-box;
  border: 1px solid #91a6b6;
  border-radius: 3px;
  padding: 6px 8px;
  background: #fff;
  color: #182f3f;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
}

.crm-rma-form-table input[type="checkbox"] {
  width: 22px;
  height: 22px;
  vertical-align: middle;
}

.crm-rma-form-actions {
  justify-content: flex-end;
  margin: 13px 0 18px;
}

.crm-rma-customer-row td {
  background: #e8f2f7 !important;
  color: #153f5a !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

.crm-rma-return { margin: 12px 0; }

@media (max-width: 1100px) {
  .crm-rma-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-rma-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-rma-summary > div:nth-child(3) { border-right: 0; }
  .crm-rma-summary > div:nth-child(n+4) { border-top: 1px solid #bdcad3; }
}

@media (max-width: 760px) {
  .crm-rma-page { padding: 0 8px 14px; font-size: 15px; }
  .crm-rma-header { align-items: stretch; flex-direction: column; }
  .crm-rma-header h1 { font-size: 22px; }
  .crm-rma-actions a { flex: 1 1 auto; }
  .crm-rma-filter-grid { grid-template-columns: 1fr; }
  .crm-rma-filter button { width: 100%; }
  .crm-rma-table-wrap { max-height: 68vh; }
  .crm-rma-table { min-width: 1050px; }
  .crm-rma-table td { font-size: 14px; }
  .crm-rma-summary { grid-template-columns: 1fr 1fr; }
  .crm-rma-summary > div,
  .crm-rma-summary > div:nth-child(3) { border-right: 1px solid #bdcad3; border-top: 1px solid #bdcad3; }
  .crm-rma-summary > div:nth-child(odd) { border-left: 0; }
  .crm-rma-summary > div:nth-child(even) { border-right: 0; }
  .crm-rma-summary > div:first-child,
  .crm-rma-summary > div:nth-child(2) { border-top: 0; }
  .crm-rma-detail-table,
  .crm-rma-detail-table tbody,
  .crm-rma-detail-table tr,
  .crm-rma-detail-table td,
  .crm-rma-form-table,
  .crm-rma-form-table tbody,
  .crm-rma-form-table tr,
  .crm-rma-form-table td { display: block; width: 100% !important; box-sizing: border-box; }
  .crm-rma-detail-table td:nth-child(3) { display: none; }
  .crm-rma-detail-table td:nth-child(4),
  .crm-rma-form-table td:first-child { border-top: 2px solid #9fb2c0; }
  .crm-rma-bottom-actions { align-items: stretch; flex-direction: column; }
  .crm-rma-bottom-actions a,
  .crm-rma-bottom-actions form,
  .crm-rma-bottom-actions input[type="submit"] { width: 100%; }
  .crm-rma-bottom-actions .is-danger { margin-left: 0; }
}

@media print {
  body {
    background: #fff;
    color: #000;
    padding: 0;
  }

  input,
  button,
  .crm-footer {
    box-shadow: none !important;
  }

  table[border="1"] {
    box-shadow: none !important;
  }
}

/* Main intranet menu as left vertical navigation */
.crm-top-vertical {
  background: #e8edf4;
  overflow: auto;
  padding: 0;
}

.crm-top-vertical.crm-menu-collapsed {
  position: relative;
  overflow: hidden;
  background: #27466d;
  cursor: pointer;
}

.crm-top-vertical .crm-menu-edge {
  display: none;
}

.crm-top-vertical.crm-menu-collapsed .crm-menu-edge {
  position: fixed;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-right: 3px solid #a9c9ee;
  border-radius: 0;
  background: #27466d;
  box-shadow: 4px 0 12px rgba(23, 50, 82, .28);
  color: #ffffff;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.crm-top-vertical.crm-menu-collapsed .crm-menu-edge:hover,
.crm-top-vertical.crm-menu-collapsed .crm-menu-edge:focus {
  outline: 0;
  border-right-color: #ffffff;
  background: #1f5b95;
  box-shadow: 5px 0 16px rgba(23, 50, 82, .34);
}

.crm-top-vertical.crm-menu-collapsed .crm-menu-edge::before {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 9px;
  height: 9px;
  border-top: 2px solid #ffffff;
  border-right: 2px solid #ffffff;
  content: "";
  transform: rotate(45deg);
}

.crm-top-vertical.crm-menu-collapsed .crm-menu-edge span {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.crm-top-vertical.crm-menu-collapsed > font > table,
.crm-top-vertical.crm-menu-collapsed > table {
  visibility: hidden;
  opacity: 0;
}

.crm-top-vertical.crm-menu-expanded {
  overflow-x: hidden;
  overflow-y: auto;
  cursor: default;
}

.crm-top-vertical.crm-menu-expanded > font > table,
.crm-top-vertical.crm-menu-expanded > table {
  animation: crm-menu-content-in .18s ease-out both;
}

@keyframes crm-menu-content-in {
  from {
    opacity: .65;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .crm-top-vertical.crm-menu-expanded > font > table,
  .crm-top-vertical.crm-menu-expanded > table,
  .crm-top-vertical.crm-menu-collapsed .crm-menu-edge {
    animation: none;
    transition: none;
  }
}

.crm-top-vertical > font > table,
.crm-top-vertical > table {
  width: auto !important;
  min-height: 0 !important;
  margin: 8px !important;
  padding: 8px !important;
  border: 1px solid #dce3ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(23, 32, 51, .1);
}

.crm-top-vertical > font > table,
.crm-top-vertical > font > table > tbody,
.crm-top-vertical > font > table > tbody > tr,
.crm-top-vertical > font > table > tbody > tr > td,
.crm-top-vertical > table,
.crm-top-vertical > table > tbody,
.crm-top-vertical > table > tbody > tr,
.crm-top-vertical > table > tbody > tr > td {
  display: block;
  width: auto !important;
}

.crm-top-vertical > font > table > tbody > tr > td:first-child,
.crm-top-vertical > table > tbody > tr > td:first-child {
  text-align: center;
  padding: 8px 4px 12px;
}

.crm-top-vertical img[src*="/media/utenti/"] {
  width: 58px !important;
  height: 64px !important;
  margin: 0 auto;
}

.crm-top-vertical table table,
.crm-top-vertical table table > tbody,
.crm-top-vertical table table > tbody > tr,
.crm-top-vertical table table > tbody > tr > td {
  display: block;
  width: auto !important;
  table-layout: auto;
}

.crm-top-vertical table table td {
  margin: 0 0 9px;
  padding: 10px !important;
  border: 1px solid #e4ebf5 !important;
  border-radius: 8px;
  background: #fbfcfe !important;
  text-align: left !important;
}

.crm-top-vertical b {
  display: block;
  margin: 0 0 8px;
  padding: 0 0 7px;
  border-bottom: 1px solid #dbe5f2;
  color: #1e3a5f;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: uppercase;
}

.crm-top-vertical a {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: none !important;
  min-height: 38px;
  margin: 3px 0;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px 9px;
  color: #243246;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  text-transform: uppercase;
  word-wrap: break-word;
}

.crm-top-vertical a:hover {
  border-color: #bdd2ff;
  background: #eef5ff;
  color: #1d4ed8;
}

.crm-top-vertical .crm-top-badge {
  margin-left: 8px;
}

.crm-top-vertical .crm-ferie-envelope,
.crm-top-vertical .crm-alert-bell {
  justify-content: center;
  width: 42px;
  height: 42px;
  margin: 7px auto;
}

.crm-top-vertical a[target="_top"] {
  justify-content: center;
  margin-top: 8px;
}

.crm-top-vertical .crm-old-crm-button {
  display: flex !important;
  justify-content: center;
  width: 100%;
  margin: 9px 0 0 !important;
  border: 1px solid #334155 !important;
  border-radius: 7px;
  background: #334155 !important;
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.crm-top-vertical .crm-old-crm-button:hover {
  background: #1f2937 !important;
  color: #ffffff !important;
}

/* Vertical menu category dropdowns */
.crm-top-vertical.crm-dropdown-ready table table td.crm-menu-section {
  margin: 0 0 7px;
  padding: 0 !important;
  overflow: hidden;
  border-color: #d7e0eb !important;
  background: #ffffff !important;
}

.crm-top-vertical .crm-menu-section > font {
  display: block;
}

.crm-top-vertical .crm-menu-section-toggle {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 11px 12px;
  border: 0;
  border-radius: 0;
  background: #f7f9fc;
  color: #1e3a5f;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.crm-top-vertical .crm-menu-section-toggle::after {
  width: 7px;
  height: 7px;
  margin-left: 10px;
  border-right: 2px solid #47617f;
  border-bottom: 2px solid #47617f;
  content: "";
  transform: rotate(45deg);
  transition: transform .16s ease;
}

.crm-top-vertical .crm-menu-section-toggle:hover,
.crm-top-vertical .crm-menu-section-toggle:focus {
  outline: 0;
  background: #eaf2ff;
  color: #174ea6;
}

.crm-top-vertical .crm-menu-section.is-open {
  border-color: #adc7eb !important;
  box-shadow: 0 2px 8px rgba(30, 58, 95, .08);
}

.crm-top-vertical .crm-menu-section.is-open .crm-menu-section-toggle {
  background: #eaf2ff;
  color: #174ea6;
}

.crm-top-vertical .crm-menu-section.is-open .crm-menu-section-toggle::after {
  transform: rotate(225deg);
}

.crm-top-vertical .crm-menu-section-panel {
  display: none;
  padding: 7px 9px 9px;
  border-top: 1px solid #dce5f0;
  background: #ffffff;
}

.crm-top-vertical .crm-menu-section.is-open .crm-menu-section-panel {
  display: block;
}

.crm-top-vertical .crm-menu-section-panel br {
  display: none;
}

.crm-top-vertical .crm-menu-section-panel a {
  min-height: 38px;
  margin: 3px 0;
  padding: 8px 9px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: uppercase;
  white-space: normal;
  word-wrap: break-word;
}

.crm-top-vertical .crm-menu-section-panel a > span:first-child {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.crm-bacheca-search {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(760px, calc(100% - 24px));
  margin: 14px auto 8px;
  padding: 10px;
  border: 1px solid #b8c5cf;
  border-radius: 6px;
  background: #ffffff;
}

.crm-bacheca-search label {
  color: #344256;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.crm-bacheca-search input[type="text"] {
  width: min(390px, 48vw);
  min-height: 38px;
  font-size: 14px;
}

.crm-bacheca-search input[type="submit"],
.crm-bacheca-search a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #155f9c;
  border-radius: 5px;
  background: #155f9c;
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none !important;
  white-space: nowrap;
}

.crm-bacheca-search a {
  border-color: #7b8b98;
  background: #ffffff;
  color: #344256 !important;
}

.crm-bacheca-results {
  margin: 10px 0 2px;
  color: #344256;
  font-size: 13px;
}

.crm-bacheca-access-card {
  width: min(430px, calc(100% - 28px));
}

.crm-bacheca-access-user {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #b8c5cf;
  border-radius: 5px;
  background: #f4f7f9;
  color: #26384a;
  font-size: 14px;
}

.crm-bacheca-access-back {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid #7b8b98;
  border-radius: 5px;
  color: #344256 !important;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none !important;
}

@media (max-width: 620px) {
  .crm-bacheca-search {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .crm-bacheca-search label,
  .crm-bacheca-search input[type="text"] {
    width: 100%;
  }
}

/* Messaggi: compact, aligned layout */
.crm-message-bar {
  padding: 6px 8px !important;
  overflow: hidden;
}

.crm-message-bar .crm-toolbar {
  min-height: 0 !important;
  padding: 7px 8px !important;
}

.crm-message-toolbar {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.crm-message-toolbar .crm-message-title {
  width: 220px;
  vertical-align: middle !important;
}

.crm-message-toolbar .crm-message-title font[size="+1"] {
  display: inline-block;
  margin-left: 8px;
  font-size: 17px;
}

.crm-message-toolbar .crm-message-filters td {
  padding: 4px 7px !important;
  vertical-align: bottom !important;
}

.crm-message-toolbar label {
  margin-bottom: 3px !important;
  font-size: 10px !important;
}

.crm-message-toolbar span {
  display: none !important;
}

.crm-message-toolbar input[type="text"] {
  height: 30px;
  max-width: 170px;
  padding: 5px 7px;
}

.crm-message-toolbar input[type="submit"] {
  min-height: 32px !important;
  padding: 7px 12px !important;
}

.crm-message-toolbar .crm-action {
  min-height: 32px;
  padding: 8px 11px;
}

.crm-message-body {
  padding: 8px 10px 12px !important;
}

.crm-message-body > center {
  max-width: none !important;
}

.crm-message-switcher {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0 0 8px !important;
  padding: 6px !important;
  box-shadow: 0 4px 12px rgba(23, 32, 51, .08) !important;
}

.crm-message-tab {
  min-height: 34px !important;
  padding: 7px 13px !important;
}

.crm-message-received-panel,
.crm-message-sent-panel {
  border: 1px solid #dbe3ef !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 20px rgba(23, 32, 51, .07) !important;
}

.crm-message-received-head,
.crm-message-sent-head {
  position: static !important;
  min-height: 0 !important;
  height: auto !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 9px 10px !important;
  border-radius: 8px 8px 0 0 !important;
  box-shadow: none !important;
}

.crm-message-received-title,
.crm-message-sent-title {
  align-items: center !important;
  flex-wrap: wrap;
  min-width: 0 !important;
  padding-top: 0 !important;
  gap: 8px !important;
}

.crm-message-received-title font[size="+1"],
.crm-message-sent-title font[size="+1"] {
  font-size: 15px !important;
}

.crm-message-received-title .crm-write-button {
  min-height: 36px !important;
  min-width: 94px !important;
  padding: 9px 15px !important;
  font-size: 13px !important;
}

.crm-message-received-actions,
.crm-message-sent-actions {
  align-items: center !important;
  gap: 6px !important;
}

.crm-message-received-actions input[type="submit"],
.crm-message-sent-actions input[type="submit"] {
  min-height: 29px !important;
  padding: 6px 8px !important;
  font-size: 10px !important;
}

.crm-message-received-columns,
.crm-message-sent-columns {
  position: static !important;
  top: auto !important;
  border-top: 1px solid #cfe7dc !important;
  border-bottom: 1px solid #cfe7dc !important;
}

.crm-message-received-columns td,
.crm-message-sent-columns td {
  padding: 7px 8px !important;
  background: #dff4ed !important;
  font-size: 11px !important;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-message-received-scroll,
.crm-message-sent-scroll {
  height: calc(100vh - 128px) !important;
  max-height: none !important;
  min-height: 310px;
  border-radius: 0 0 8px 8px;
}

.crm-message-received-scroll > table,
.crm-message-sent-scroll > table {
  border-collapse: collapse !important;
}

.crm-message-columns table[border="1"] td {
  padding: 7px 8px !important;
  font-size: 12px !important;
  line-height: 1.25;
}

.crm-message-received-columns td:nth-child(1),
.crm-message-sent-columns td:nth-child(1),
.crm-message-received-scroll > table tr td:nth-child(1),
.crm-message-sent-scroll > table tr td:nth-child(1) {
  width: 28px !important;
  padding-left: 3px !important;
  padding-right: 3px !important;
}

.crm-message-received-columns td:nth-child(2),
.crm-message-sent-columns td:nth-child(2),
.crm-message-received-scroll > table tr td:nth-child(2),
.crm-message-sent-scroll > table tr td:nth-child(2) {
  width: 116px !important;
  padding-left: 5px !important;
  text-align: left !important;
  white-space: nowrap;
}

.crm-message-received-columns td:nth-child(3),
.crm-message-sent-columns td:nth-child(3),
.crm-message-received-scroll > table tr td:nth-child(3),
.crm-message-sent-scroll > table tr td:nth-child(3) {
  width: 66px !important;
  padding-left: 4px !important;
  padding-right: 4px !important;
}

.crm-message-received-columns td:nth-child(4),
.crm-message-sent-columns td:nth-child(4),
.crm-message-received-scroll > table tr td:nth-child(4),
.crm-message-sent-scroll > table tr td:nth-child(4) {
  width: 96px !important;
  padding-left: 5px !important;
  padding-right: 5px !important;
}

.crm-message-received-columns td:nth-child(5),
.crm-message-sent-columns td:nth-child(5),
.crm-message-received-scroll > table tr td:nth-child(5),
.crm-message-sent-scroll > table tr td:nth-child(5) {
  padding-left: 4px !important;
  padding-right: 5px !important;
  text-align: left !important;
}

.crm-message-received-columns td:nth-child(6),
.crm-message-sent-columns td:nth-child(6),
.crm-message-received-scroll > table tr td:nth-child(6),
.crm-message-sent-scroll > table tr td:nth-child(6) {
  width: 122px !important;
}

.crm-message-body td.crm-message-subject a {
  display: inline !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.crm-message-body td.crm-message-person {
  font-weight: 800;
}

/* Messaggi: griglia unica e layout senza sovrapposizioni */
.crm-message-bar .crm-message-toolbar {
  width: 100% !important;
  min-height: 132px !important;
  table-layout: fixed !important;
}

.crm-message-bar .crm-message-toolbar .crm-message-title {
  width: auto !important;
}

.crm-message-bar .crm-message-filters td {
  box-sizing: border-box;
  overflow: hidden;
}

.crm-message-bar .crm-message-filters td:nth-child(1),
.crm-message-bar .crm-message-filters td:nth-child(2) {
  width: 14%;
}

.crm-message-bar .crm-message-filters td:nth-child(3) {
  width: 20%;
}

.crm-message-bar .crm-message-filters td:nth-child(4) {
  width: 42%;
  white-space: normal !important;
}

.crm-message-bar .crm-message-filters td:nth-child(5) {
  width: 10%;
}

.crm-message-bar .crm-message-filters td:nth-child(4) .crm-action {
  margin: 3px 3px 0 0;
  padding: 7px 9px;
  font-size: 10px;
}

.crm-message-received-head,
.crm-message-sent-head {
  display: grid !important;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center !important;
  min-height: 62px !important;
}

.crm-message-received-actions,
.crm-message-sent-actions {
  min-width: 0;
}

.crm-message-received-actions input[type="submit"],
.crm-message-sent-actions input[type="submit"] {
  max-width: 210px;
  white-space: normal !important;
  line-height: 1.15;
}

.crm-message-received-scroll,
.crm-message-sent-scroll {
  height: calc(100vh - 150px) !important;
  min-height: 280px;
  overflow: auto !important;
  scrollbar-gutter: stable;
}

.crm-message-table {
  width: 100% !important;
  min-width: 760px;
  margin: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  table-layout: fixed !important;
  box-shadow: none !important;
}

.crm-message-table col:nth-child(1) { width: 42px; }
.crm-message-table col:nth-child(2) { width: 150px; }
.crm-message-table col:nth-child(3) { width: 96px; }
.crm-message-table col:nth-child(4) { width: 150px; }
.crm-message-table col:nth-child(6) { width: 150px; }

.crm-message-table thead {
  position: sticky;
  top: 0;
  z-index: 20;
}

body.crm-message-body table.crm-message-table thead th {
  box-sizing: border-box;
  height: 42px;
  padding: 8px 7px;
  border: 0;
  border-right: 1px solid #718096;
  border-bottom: 1px solid #718096;
  background: #344256 !important;
  color: #fff !important;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
}

body.crm-message-body table.crm-message-table thead th:nth-child(4),
body.crm-message-body table.crm-message-table thead th:nth-child(5) {
  text-align: left;
}

body.crm-message-body table.crm-message-table thead th:last-child {
  border-right: 0;
}

body.crm-message-body table.crm-message-table thead a {
  display: block !important;
  min-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
  font-size: inherit !important;
  text-align: inherit;
  text-decoration: none !important;
}

body.crm-message-body table.crm-message-table thead a:hover {
  color: #fff !important;
  text-decoration: underline !important;
}

body.crm-message-body table.crm-message-table thead input[type="button"] {
  min-width: 25px !important;
  min-height: 25px;
  padding: 2px 6px !important;
  border-color: #cbd5e1;
  background: #fff;
}

body.crm-message-body table.crm-message-table tbody td {
  box-sizing: border-box;
  width: auto !important;
  padding: 8px 7px !important;
  border-right: 1px solid #b6c1cf !important;
  border-bottom: 1px solid #d6dee8 !important;
  font-size: 15px !important;
  line-height: 1.3;
  vertical-align: middle;
}

body.crm-message-body table.crm-message-table tbody td:last-child {
  border-right: 0 !important;
}

body.crm-message-body table.crm-message-table tbody td:nth-child(1),
body.crm-message-body table.crm-message-table tbody td:nth-child(3),
body.crm-message-body table.crm-message-table tbody td:nth-child(6) {
  text-align: center !important;
}

body.crm-message-body table.crm-message-table tbody td:nth-child(2) {
  overflow: hidden;
  text-align: left !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.crm-message-body table.crm-message-table tbody td:nth-child(4),
body.crm-message-body table.crm-message-table tbody td:nth-child(5) {
  text-align: left !important;
}

body.crm-message-body table.crm-message-table tbody td:nth-child(3),
body.crm-message-body table.crm-message-table tbody td:nth-child(4),
body.crm-message-body table.crm-message-table tbody td:nth-child(6) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.crm-message-body table.crm-message-table tbody td:nth-child(4) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.crm-message-body table.crm-message-table tbody td:nth-child(5) {
  overflow-wrap: anywhere;
}

.crm-message-received-title font[size="+1"],
.crm-message-sent-title font[size="+1"] {
  font-size: 17px !important;
}

.crm-message-compose td {
  font-size: 15px;
  line-height: 1.4;
}

.crm-message-compose select,
.crm-message-compose input[type="text"],
.crm-message-compose textarea {
  font-size: 15px !important;
  line-height: 1.45;
}

.crm-message-view {
  width: min(920px, 96%);
  margin: 10px auto 0;
  font-size: 15px;
}

.crm-message-view td {
  padding: 9px 10px !important;
  font-size: 15px !important;
  line-height: 1.4;
}

.crm-message-view td:first-child {
  width: 120px;
  font-size: 14px !important;
}

.crm-message-view textarea {
  width: min(720px, 100%);
  min-height: 220px;
  padding: 12px;
  font-size: 16px !important;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .crm-message-received-head,
  .crm-message-sent-head {
    grid-template-columns: 1fr;
  }

  .crm-message-received-actions,
  .crm-message-sent-actions {
    justify-content: flex-start !important;
  }

  .crm-message-received-scroll,
  .crm-message-sent-scroll {
    height: calc(100vh - 210px) !important;
  }
}
/* Riepilogo giornaliero eSHOP visibile esclusivamente all'utente autorizzato. */
.crm-profit-strip {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: grid;
  grid-template-columns: minmax(118px, auto) minmax(0, 1fr) auto;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
  min-height: 56px;
  margin: 0 0 10px;
  border: 1px solid #b8c6d6;
  border-radius: 0 0 6px 6px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(22, 42, 68, .12);
  color: #172436;
  font-family: "Century Gothic", CenturyGothic, AppleGothic, Arial, sans-serif;
}

body .crm-profit-strip .crm-profit-strip-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px;
  border-right: 1px solid #c9d4e1;
  background: #213a57;
  color: #ffffff !important;
  text-decoration: none !important;
}

body .crm-profit-strip .crm-profit-strip-title:hover,
body .crm-profit-strip .crm-profit-strip-title:focus,
body .crm-profit-strip .crm-profit-strip-title:visited {
  border-color: #213a57;
  background: #213a57 !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

.crm-profit-strip-title span {
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}

.crm-profit-strip-title small {
  margin-top: 3px;
  color: #d9e6f3;
  font-size: 10px;
}

.crm-profit-strip-title strong {
  margin-top: 2px;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.1;
  white-space: nowrap;
}

.crm-profit-strip-values {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  min-width: 0;
}

.crm-profit-strip.is-centered-total {
  grid-template-columns: minmax(0, 1fr) minmax(205px, 232px) minmax(0, 1fr) 70px;
}

.crm-profit-strip.is-centered-total .crm-profit-strip-title {
  grid-column: 2;
  grid-row: 1;
  align-items: center;
  padding: 6px 14px;
  border-right: 2px solid #0b3826;
  border-left: 2px solid #0b3826;
  background: #0f5132;
  text-align: center;
  box-shadow: inset 0 3px 0 #2aa36f, inset 0 -3px 0 #0a3924;
}

body .crm-profit-strip.is-centered-total .crm-profit-strip-title:hover,
body .crm-profit-strip.is-centered-total .crm-profit-strip-title:focus,
body .crm-profit-strip.is-centered-total .crm-profit-strip-title:visited {
  border-color: #0b3826;
  background: #0f5132 !important;
}

.crm-profit-strip.is-centered-total .crm-profit-strip-title span {
  font-size: 12px;
}

.crm-profit-strip.is-centered-total .crm-profit-strip-title strong {
  margin-top: 3px;
  font-size: 22px;
  line-height: 1;
}

.crm-profit-strip.is-centered-total .crm-profit-strip-title small {
  margin-top: 2px;
  font-size: 9px;
}

.crm-profit-strip.is-centered-total .crm-profit-strip-values {
  display: contents;
}

.crm-profit-metrics-side {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(82px, 1fr));
}

.crm-profit-strip.is-centered-total .crm-profit-metrics-left {
  grid-column: 1;
  grid-row: 1;
}

.crm-profit-strip.is-centered-total .crm-profit-metrics-right {
  grid-column: 3;
  grid-row: 1;
}

.crm-profit-strip.is-centered-total .crm-profit-strip-time {
  grid-column: 4;
  grid-row: 1;
}

.crm-profit-metric {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 7px 9px;
  border-right: 1px solid #d8e0e9;
  text-align: center;
}

.crm-profit-metric small {
  overflow: hidden;
  color: #5c6978;
  font-size: 9px;
  font-weight: bold;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.crm-profit-metric strong {
  overflow: hidden;
  margin-top: 3px;
  color: #172436;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-profit-metric.is-positive strong { color: #08734b; }
.crm-profit-metric.is-negative strong { color: #b42318; }
.crm-profit-metric.is-store { background: #f4f7fa; }
.crm-profit-metric.is-store-total {
  background: #e7f3ed;
  box-shadow: inset 0 3px 0 #4d9a73;
}
.crm-profit-metric.is-store-total strong { font-size: 14px; }
.crm-profit-metric.is-store small {
  overflow: visible;
  line-height: 1.05;
  text-overflow: clip;
  white-space: normal;
}
.crm-profit-total-source { display: none; }

.crm-profit-strip-time {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  padding: 6px;
  color: #667587;
  font-size: 8px;
  line-height: 1.25;
  text-align: center;
}

.crm-profit-strip-loading,
.crm-profit-strip-error {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  color: #526273;
  font-size: 11px;
  font-weight: bold;
}

.crm-profit-strip-error { color: #a4251c; }

body.crm-profit-frame {
  box-sizing: border-box;
  margin: 0;
  padding: 8px 12px !important;
  overflow: hidden;
  background: #edf2f7;
}

.crm-profit-frame .crm-profit-strip {
  grid-template-columns: 160px minmax(0, 1fr) 82px;
  height: 64px;
  min-height: 64px;
  margin: 0;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(22, 42, 68, .14);
}

.crm-profit-frame .crm-profit-strip-title { padding: 4px 12px; }
.crm-profit-frame .crm-profit-strip-title span {
  font-size: 10px;
  line-height: 1.05;
  white-space: normal;
}
.crm-profit-frame .crm-profit-strip-title strong { font-size: 16px; }
.crm-profit-frame .crm-profit-strip-title small { font-size: 9px; }
.crm-profit-frame .crm-profit-metric small { font-size: 10px; }
.crm-profit-frame .crm-profit-metric strong { font-size: 15px; }
.crm-profit-frame .crm-profit-strip-time { width: 72px; font-size: 9px; }

.crm-profit-frame .crm-profit-strip.is-centered-total {
  grid-template-columns: minmax(0, 1fr) minmax(205px, 232px) minmax(0, 1fr) 72px;
}

.crm-profit-frame .crm-profit-strip.is-centered-total .crm-profit-strip-title span { font-size: 12px; }
.crm-profit-frame .crm-profit-strip.is-centered-total .crm-profit-strip-title strong { font-size: 22px; }

@media (max-width: 920px) {
  .crm-profit-strip {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .crm-profit-strip-values {
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
  }

  .crm-profit-metric { flex: 0 0 104px; }
  .crm-profit-strip-time { display: none; }

  .crm-profit-strip.is-centered-total {
    grid-template-columns: minmax(0, 1fr) 190px minmax(0, 1fr);
  }

  .crm-profit-strip.is-centered-total .crm-profit-strip-values { display: contents; }

  .crm-profit-strip.is-centered-total .crm-profit-metrics-side {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .crm-profit-strip.is-centered-total .crm-profit-metric { flex: 0 0 104px; }
}

@media (max-width: 600px) {
  .crm-profit-strip {
    position: sticky;
    grid-template-columns: 94px minmax(0, 1fr);
  }

  body .crm-profit-strip .crm-profit-strip-title { padding: 7px 8px; }
  .crm-profit-strip-title span { white-space: normal; }
  .crm-profit-strip-values { display: flex; }
  .crm-profit-metric { padding: 6px; }
  .crm-profit-metric strong { font-size: 11px; }

  body.crm-profit-frame { padding: 4px 6px !important; }
  .crm-profit-frame .crm-profit-strip {
    grid-template-columns: 94px minmax(0, 1fr);
    height: 118px;
    min-height: 118px;
  }

  .crm-profit-strip.is-centered-total,
  .crm-profit-frame .crm-profit-strip.is-centered-total {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 58px 60px;
  }

  .crm-profit-strip.is-centered-total .crm-profit-strip-title {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
  }

  .crm-profit-strip.is-centered-total .crm-profit-strip-values {
    display: flex;
    grid-column: 1;
    grid-row: 2;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .crm-profit-strip.is-centered-total .crm-profit-metrics-side { display: contents; }
}

/* Contrasto moderato e uniforme per le superfici operative. */
.crm-page,
.crm-module-body,
.crm-home-page,
.crm-archive,
.crm-popup {
  background: linear-gradient(180deg, #f2f5f8 0, var(--crm-bg) 220px);
}

input,
select,
textarea {
  border-color: #b5c1d0;
  box-shadow: inset 0 1px 2px rgba(18, 27, 43, 0.05);
}

input:focus,
select:focus,
textarea:focus {
  outline-color: rgba(37, 99, 235, 0.24);
  border-color: #5f89e7;
}

table[border="1"],
.crm-work-sheet-header,
.crm-work-section,
.crm-footer,
.crm-sottoscorta-scroll,
.crm-home > table:first-of-type > tbody > tr > td,
.crm-home > table:first-of-type > tr > td,
.crm-home > table:nth-of-type(2) > tbody > tr > td,
.crm-home > table:nth-of-type(2) > tr > td {
  border-color: #c1ccd9 !important;
}

table[border="1"] td,
table[border="1"] th,
.crm-contract-table td {
  border-bottom-color: #d4dde7 !important;
}

table[border="1"] tr:first-child td,
table[border="1"] tr:first-child th,
.crm-contract-table th {
  background: #e3eaf3 !important;
  color: #28384d;
}

.crm-page table[border="1"] tr:not(:first-child):not([bgcolor]):nth-child(odd) td,
.crm-module-body table[border="1"] tr:not(:first-child):not([bgcolor]):nth-child(odd) td,
.crm-archive table[border="1"] tr:not(:first-child):not([bgcolor]):nth-child(odd) td {
  background: #ffffff !important;
}

.crm-page table[border="1"] tr:not(:first-child):not([bgcolor]):nth-child(even) td,
.crm-module-body table[border="1"] tr:not(:first-child):not([bgcolor]):nth-child(even) td,
.crm-archive table[border="1"] tr:not(:first-child):not([bgcolor]):nth-child(even) td {
  background: #edf2f7 !important;
}

.crm-page table[border="1"] tr:not(:first-child):not([bgcolor]):hover td,
.crm-module-body table[border="1"] tr:not(:first-child):not([bgcolor]):hover td,
.crm-archive table[border="1"] tr:not(:first-child):not([bgcolor]):hover td {
  background: #dce8f8 !important;
}

.crm-top {
  background: #dce4ed;
}

.crm-top > font > table,
.crm-top > table {
  border-color: #bec9d6;
  box-shadow: 0 8px 22px rgba(23, 32, 51, 0.13);
}

.crm-top table table td {
  border-left-color: #d1dae5;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fa 100%) !important;
}

.crm-top b {
  border-bottom-color: #d5dee8;
  color: #2c3b50;
}

.crm-home-online-user {
  border-color: #c7d8d0;
  background: #f3f8f5;
}

.crm-user-media-message {
  max-width: 760px;
  margin: 0 auto 16px;
  padding: 11px 14px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.crm-user-media-success {
  border-color: #79ad8d;
  background: #e9f5ed;
  color: #1f6840;
}

.crm-user-media-error {
  border-color: #d29a9a;
  background: #fff0f0;
  color: #9d2727;
}

.crm-user-avatar-preview {
  width: 70px;
  height: 80px;
  border: 1px solid #b8c4cf;
  border-radius: 5px;
  background: #fff;
  object-fit: cover;
}

.crm-user-audio-preview {
  width: min(100%, 290px);
  height: 38px;
}

.crm-user-audio-warning {
  display: inline-block;
  max-width: 290px;
  margin-top: 5px;
  color: #9d4b18;
  font-size: 11px;
  line-height: 1.3;
}

/* Trasferimento magazzini */
.crm-transfer-sheet {
  max-width: 1280px;
}

.crm-transfer-route {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 52px minmax(220px, 1fr);
  align-items: end;
  gap: 14px;
  max-width: 760px;
}

.crm-transfer-arrow {
  display: grid;
  place-items: center;
  min-height: 42px;
  color: #175b91;
  font-size: 28px;
  font-weight: 900;
}

.crm-transfer-search {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.crm-transfer-search button,
.crm-transfer-add,
#tm-submit {
  min-height: 42px;
  border: 1px solid #154f7e;
  border-radius: 5px;
  background: #1769aa;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
}

.crm-transfer-search button {
  min-width: 110px;
}

.crm-transfer-search-status {
  min-height: 22px;
  margin-top: 9px;
  color: #526274;
  font-size: 13px;
  font-weight: 800;
}

.crm-transfer-search-status .is-error,
.crm-transfer-inline-error,
.crm-transfer-projection .is-error {
  color: #a52121;
}

.crm-transfer-search-status .is-success,
.crm-transfer-projection .is-ok {
  color: #17603a;
}

.crm-transfer-loading::before {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 7px;
  border: 2px solid #b7cadc;
  border-top-color: #1769aa;
  border-radius: 50%;
  content: "";
  vertical-align: -2px;
  animation: crm-transfer-spin .7s linear infinite;
}

@keyframes crm-transfer-spin { to { transform: rotate(360deg); } }

.crm-transfer-inline-error {
  min-height: 18px;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 800;
}

.crm-transfer-results,
.crm-transfer-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid #c1ccd9;
  border-radius: 5px;
  background: #fff;
}

.crm-transfer-results {
  max-height: 350px;
  margin-top: 8px;
}

.crm-transfer-results table,
.crm-transfer-table,
.crm-transfer-history {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.crm-transfer-results th,
.crm-transfer-results td,
.crm-transfer-table th,
.crm-transfer-table td,
.crm-transfer-history th,
.crm-transfer-history td {
  border-right: 1px solid #d1dae5;
  border-bottom: 1px solid #d1dae5;
  padding: 9px 8px;
  text-align: left;
  vertical-align: middle;
}

.crm-transfer-results th,
.crm-transfer-table th,
.crm-transfer-history th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #e3eaf3;
  color: #28384d;
  font-size: 12px;
  text-transform: uppercase;
}

.crm-transfer-results tr:nth-child(even) td,
.crm-transfer-table tbody tr:nth-child(even) td,
.crm-transfer-history tbody tr:nth-child(even) td {
  background: #f4f7fa;
}

.crm-transfer-results th:nth-child(1) { width: 16%; }
.crm-transfer-results th:nth-child(2) { width: 40%; }
.crm-transfer-results th:nth-child(3),
.crm-transfer-results th:nth-child(4),
.crm-transfer-results th:nth-child(5) { width: 11%; text-align: center; }
.crm-transfer-results th:nth-child(6) { width: 11%; }
.crm-transfer-results td:nth-child(3),
.crm-transfer-results td:nth-child(4),
.crm-transfer-results td:nth-child(5) { text-align: center; font-weight: 800; }

.crm-transfer-add {
  min-height: 34px;
  width: 100%;
}

.crm-transfer-table th:nth-child(1) { width: 13%; }
.crm-transfer-table th:nth-child(2) { width: 27%; }
.crm-transfer-table th:nth-child(3),
.crm-transfer-table th:nth-child(4),
.crm-transfer-table th:nth-child(5) { width: 8%; text-align: center; }
.crm-transfer-table th:nth-child(6) { width: 8%; }
.crm-transfer-table th:nth-child(7) { width: 16%; }
.crm-transfer-table th:nth-child(8) { width: 4%; }

.crm-transfer-stock {
  text-align: center !important;
  font-size: 15px;
  font-weight: 900;
}

.crm-transfer-stock-help {
  margin: -5px 0 12px;
  color: #526274;
  font-size: 13px;
  font-weight: 700;
}

.crm-transfer-stock-input {
  width: 64px !important;
  min-width: 52px;
  height: 38px;
  margin: 0 auto;
  padding: 5px !important;
  text-align: center;
  font-size: 15px !important;
  font-weight: 900 !important;
}

.crm-transfer-stock-input.is-edited {
  border-color: #c07a18 !important;
  background: #fff4d9 !important;
  color: #754209 !important;
}

.crm-transfer-qty {
  min-width: 58px;
  max-width: 78px;
  height: 38px;
  text-align: center;
  font-size: 16px !important;
  font-weight: 900 !important;
}

.crm-transfer-projection {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.crm-transfer-remove {
  width: 34px;
  height: 34px;
  border: 1px solid #bd5a5a;
  border-radius: 4px;
  background: #fff;
  color: #a52121;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.crm-transfer-empty td,
.crm-transfer-history-empty {
  padding: 20px !important;
  color: #667587;
  text-align: center !important;
  font-weight: 800;
}

.crm-transfer-confirm {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 14px;
}

.crm-work-sheet .crm-transfer-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: #34455a;
  font-size: 13px;
  text-transform: none;
}

.crm-transfer-check input {
  width: 20px;
  height: 20px;
}

#tm-submit {
  padding: 0 18px;
  background: #17603a;
  border-color: #124f30;
}

.crm-transfer-message {
  margin-bottom: 14px;
  border: 1px solid;
  border-radius: 5px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 900;
}

.crm-transfer-message.is-error { border-color: #dc8d8d; background: #fff0f0; color: #992020; }
.crm-transfer-message.is-success { border-color: #86b99a; background: #eaf6ee; color: #17603a; }

.crm-transfer-ddt-link,
.crm-transfer-ddt-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #17603a;
  border-radius: 4px;
  background: #fff;
  color: #17603a !important;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.crm-transfer-ddt-link {
  min-height: 34px;
  margin-left: 12px;
  padding: 0 12px;
}

.crm-transfer-ddt-small {
  min-height: 30px;
  min-width: 62px;
  padding: 0 7px;
}

.crm-transfer-history th:nth-child(1) { width: 11%; }
.crm-transfer-history th:nth-child(2) { width: 8%; }
.crm-transfer-history th:nth-child(3) { width: 8%; }
.crm-transfer-history th:nth-child(4) { width: 12%; }
.crm-transfer-history th:nth-child(5) { width: 22%; }
.crm-transfer-history th:nth-child(6),
.crm-transfer-history th:nth-child(7) { width: 10%; }
.crm-transfer-history th:nth-child(8) { width: 5%; }
.crm-transfer-history th:nth-child(9) { width: 14%; }

html.crm-transfer-preview-open,
html.crm-transfer-preview-open body {
  overflow: hidden;
}

.crm-transfer-preview[hidden] {
  display: none !important;
}

.crm-transfer-preview {
  position: fixed;
  z-index: 10020;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 33, 47, .68);
}

.crm-transfer-preview-panel {
  width: min(1080px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid #8fa1b4;
  border-radius: 6px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(14, 27, 39, .3);
}

.crm-transfer-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 2px solid #26394d;
  padding-bottom: 14px;
}

.crm-transfer-preview-kicker {
  display: block;
  margin-bottom: 3px;
  color: #1769aa;
  font-size: 11px;
  font-weight: 900;
}

.crm-transfer-preview-head h2 {
  margin: 0;
  color: #1f3043;
  font-size: 22px;
}

.crm-transfer-preview-close {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid #93a2b2;
  border-radius: 4px;
  background: #fff;
  color: #34485d;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.crm-transfer-preview-route {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 48px minmax(180px, 1fr);
  align-items: center;
  margin-top: 16px;
  border: 1px solid #bac6d2;
  background: #eef3f7;
}

.crm-transfer-preview-route span,
.crm-transfer-preview-route b {
  padding: 13px;
  text-align: center;
}

.crm-transfer-preview-route span {
  color: #23374b;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-transfer-preview-route b {
  border-right: 1px solid #bac6d2;
  border-left: 1px solid #bac6d2;
  color: #1769aa;
  font-size: 22px;
}

.crm-transfer-preview-note {
  margin: 14px 0;
  color: #34485c;
  font-size: 14px;
}

.crm-transfer-preview-table-wrap {
  max-height: 390px;
  overflow: auto;
  border: 1px solid #aebbc8;
}

.crm-transfer-preview-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.crm-transfer-preview-table th,
.crm-transfer-preview-table td {
  border-right: 1px solid #c4ced8;
  border-bottom: 1px solid #c4ced8;
  padding: 9px 8px;
  text-align: left;
  vertical-align: middle;
}

.crm-transfer-preview-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #dfe8f1;
  color: #26394d;
  font-size: 11px;
  text-transform: uppercase;
}

.crm-transfer-preview-table tr:nth-child(even) td {
  background: #f4f7fa;
}

.crm-transfer-preview-table th:nth-child(1) { width: 6%; text-align: center; }
.crm-transfer-preview-table th:nth-child(2) { width: 16%; }
.crm-transfer-preview-table th:nth-child(3) { width: 34%; }
.crm-transfer-preview-table th:nth-child(4) { width: 10%; text-align: center; }
.crm-transfer-preview-table th:nth-child(5),
.crm-transfer-preview-table th:nth-child(6) { width: 17%; text-align: center; }
.crm-transfer-preview-table td:nth-child(1),
.crm-transfer-preview-table td:nth-child(4),
.crm-transfer-preview-table td:nth-child(5),
.crm-transfer-preview-table td:nth-child(6) { text-align: center; }

.crm-transfer-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.crm-transfer-preview-actions button {
  min-height: 44px;
  border: 1px solid;
  border-radius: 5px;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.crm-transfer-preview-actions .is-secondary {
  border-color: #8292a3;
  background: #fff;
  color: #31465a;
}

.crm-transfer-preview-actions .is-primary {
  border-color: #124f30;
  background: #17603a;
  color: #fff;
}

.crm-transfer-preview-actions button:disabled {
  cursor: wait;
  opacity: .72;
}

@media (max-width: 760px) {
  .crm-transfer-route,
  .crm-transfer-search {
    grid-template-columns: 1fr;
  }
  .crm-transfer-arrow {
    min-height: 22px;
    transform: rotate(90deg);
  }
  .crm-transfer-confirm {
    align-items: stretch;
    flex-direction: column;
  }
  #tm-submit {
    min-height: 48px;
  }
  .crm-transfer-table-wrap,
  .crm-transfer-results {
    border-radius: 3px;
  }
  .crm-transfer-results table,
  .crm-transfer-table,
  .crm-transfer-history {
    min-width: 900px;
  }
  .crm-transfer-preview {
    place-items: end center;
    padding: 0;
  }
  .crm-transfer-preview-panel {
    width: 100%;
    max-height: 94vh;
    border-radius: 6px 6px 0 0;
    padding: 16px;
  }
  .crm-transfer-preview-route {
    grid-template-columns: 1fr 36px 1fr;
  }
  .crm-transfer-preview-table {
    min-width: 760px;
  }
  .crm-transfer-preview-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}

/* Preparazione macchine */
.crm-pm-page {
  max-width: 1500px;
}

.crm-pm-head-actions {
  flex-wrap: wrap;
}

.crm-page .crm-pm-button {
  min-height: 38px;
  padding: 0 14px;
  border-color: #8192a5;
  background: #fff;
  color: #26394d;
  font-size: 12px;
}

.crm-page .crm-pm-button.is-primary {
  border-color: #175b91;
  background: #1769aa;
  color: #fff;
}

.crm-pm-filters {
  display: grid;
  grid-template-columns: 120px minmax(220px, 1.4fr) minmax(190px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
}

.crm-pm-filters label {
  display: grid;
  gap: 5px;
  color: #40536a;
  font-size: 11px;
  font-weight: 900;
}

.crm-pm-filters input[type="text"],
.crm-pm-filters select {
  width: 100%;
  min-height: 40px;
  font-size: 13px;
}

.crm-pm-filters .crm-pm-archive {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  border: 1px solid #c1ccd9;
  border-radius: 5px;
  padding: 0 11px;
  background: #f7f9fb;
  white-space: nowrap;
}

.crm-pm-filters .crm-pm-archive input {
  width: 19px;
  height: 19px;
  margin: 0;
}

.crm-pm-filters button {
  min-width: 110px;
  min-height: 40px;
}

.crm-pm-results {
  padding: 0 !important;
  overflow: hidden;
}

.crm-pm-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #c4cfdb;
  padding: 11px 14px;
  background: #edf2f7;
}

.crm-pm-section-head h2 {
  margin: 0;
  font-size: 15px;
}

.crm-pm-section-head span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid #aebdcb;
  border-radius: 4px;
  padding: 0 9px;
  background: #fff;
  color: #3e5166;
  font-size: 12px;
  font-weight: 900;
}

.crm-pm-table-wrap {
  max-height: 620px;
  overflow: auto;
}

.crm-pm-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  font-size: 13px;
}

.crm-pm-table th,
.crm-pm-table td {
  border-right: 1px solid #d0d9e3;
  border-bottom: 1px solid #d0d9e3;
  padding: 9px 8px;
  text-align: center;
  vertical-align: middle;
}

.crm-pm-table th:last-child,
.crm-pm-table td:last-child {
  border-right: 0;
}

.crm-pm-table th {
  position: sticky;
  z-index: 3;
  top: 0;
  background: #dfe7f0;
  color: #26394d;
  font-size: 11px;
  font-weight: 900;
}

.crm-page .crm-pm-table th a {
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.crm-pm-table tbody tr:nth-child(even) td {
  background: #f6f8fb;
}

.crm-pm-table tbody tr:hover td {
  background: #edf4fa;
}

.crm-pm-table th:nth-child(1) { width: 5%; }
.crm-pm-table th:nth-child(2) { width: 20%; }
.crm-pm-table th:nth-child(3) { width: 10%; }
.crm-pm-table th:nth-child(4) { width: 7%; }
.crm-pm-table th:nth-child(5) { width: 5%; }
.crm-pm-table th:nth-child(6) { width: 12%; }
.crm-pm-table th:nth-child(7) { width: 9%; }
.crm-pm-table th:nth-child(8),
.crm-pm-table th:nth-child(9),
.crm-pm-table th:nth-child(10) { width: 9%; }
.crm-pm-table th:nth-child(11) { width: 9%; }

.crm-pm-id,
.crm-pm-qty,
.crm-pm-money {
  font-weight: 900;
  white-space: nowrap;
}

.crm-pm-money {
  text-align: right !important;
}

.crm-pm-residual {
  color: #9b2c2c;
}

.crm-page .crm-pm-client a,
.crm-page .crm-pm-detail {
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #174f7c;
}

.crm-page .crm-pm-client a {
  display: block;
  text-align: left;
}

.crm-pm-client b,
.crm-pm-client span,
.crm-pm-table small {
  display: block;
}

.crm-pm-client b {
  color: #17283b;
  font-size: 13px;
}

.crm-pm-client span,
.crm-pm-table small {
  margin-top: 2px;
  color: #617185;
  font-size: 10px;
  font-weight: 800;
}

.crm-pm-status,
.crm-pm-urgent {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  border: 1px solid #aebac7;
  border-radius: 4px;
  padding: 0 8px;
  background: #eef2f6;
  color: #435266;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-pm-status.is-ordered { border-color: #8eb5d6; background: #e4f1fb; color: #18547d; }
.crm-pm-status.is-working { border-color: #d7b75a; background: #fff5cc; color: #705400; }
.crm-pm-status.is-waiting { border-color: #d7a35b; background: #fff0d8; color: #7a4700; }
.crm-pm-status.is-blocked { border-color: #d98d8d; background: #fde8e8; color: #8a2020; }
.crm-pm-status.is-ready { border-color: #75b88d; background: #e2f4e8; color: #176137; }
.crm-pm-status.is-delivered { border-color: #a8b4c1; background: #edf1f5; color: #4d5b6a; }
.crm-pm-urgent.is-urgent { border-color: #d78181; background: #fde5e5; color: #9a2020; }

.crm-pm-call {
  color: #a52121 !important;
}

.crm-pm-empty {
  padding: 28px !important;
  color: #64748b;
  font-weight: 800;
  text-align: center !important;
}

.crm-pm-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.crm-pm-summary > div {
  border: 1px solid #c3ceda;
  border-radius: 6px;
  padding: 12px 13px;
  background: #fff;
}

.crm-pm-summary span,
.crm-pm-summary b {
  display: block;
}

.crm-pm-summary span {
  color: #5b6c80;
  font-size: 10px;
  font-weight: 900;
}

.crm-pm-summary b {
  margin-top: 4px;
  color: #17283b;
  font-size: 18px;
}

/* Allineamento comune dei moduli ancora basati sul markup storico. */
.crm-module-page > center:not(.crm-section-home),
.crm-module-page > font > center:not(.crm-section-home) {
  width: 100%;
  max-width: 1500px;
  margin-right: auto;
  margin-left: auto;
  overflow-x: auto;
  text-align: left;
}

.crm-module-page > center:not(.crm-section-home) > font[size="+1"]:first-child,
.crm-module-page > center:not(.crm-section-home) > font[size="+2"]:first-child,
.crm-module-page > font > center:not(.crm-section-home) > font[size="+1"]:first-child,
.crm-module-page > font > center:not(.crm-section-home) > font[size="+2"]:first-child {
  display: block;
  margin: 2px 0 14px;
  color: #17283b;
  font-size: 23px;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-module-page > center:not(.crm-section-home) > form,
.crm-module-page > font > center:not(.crm-section-home) > form {
  max-width: 100%;
  margin: 0 0 14px;
  overflow-x: auto;
}

.crm-module-page > center:not(.crm-section-home) > form > table[bgcolor],
.crm-module-page > font > center:not(.crm-section-home) > form > table[bgcolor] {
  width: 100%;
  margin: 0;
  border: 1px solid #c2ceda;
  border-radius: 6px;
  border-spacing: 7px;
  box-shadow: none;
}

.crm-module-page > center:not(.crm-section-home) > table[width="100%"][border="1"],
.crm-module-page > font > center:not(.crm-section-home) > table[width="100%"][border="1"] {
  border-collapse: collapse;
  border-radius: 6px;
  box-shadow: none;
  font-size: 13px;
}

.crm-module-page > center:not(.crm-section-home) > table[width="100%"][border="1"] tr:first-child td,
.crm-module-page > center:not(.crm-section-home) > table[width="100%"][border="1"] tr:first-child th,
.crm-module-page > font > center:not(.crm-section-home) > table[width="100%"][border="1"] tr:first-child td,
.crm-module-page > font > center:not(.crm-section-home) > table[width="100%"][border="1"] tr:first-child th {
  position: sticky;
  z-index: 2;
  top: 0;
  border-right: 1px solid #b7c5d4 !important;
  background: #dfe7f0 !important;
  color: #26394d;
  text-align: center;
}

.crm-module-page > center:not(.crm-section-home) > table[width="100%"][border="1"] tr:not(:first-child) td,
.crm-module-page > font > center:not(.crm-section-home) > table[width="100%"][border="1"] tr:not(:first-child) td {
  border-right: 1px solid #d4dde6 !important;
  font-size: 13px;
}

.crm-module-page > center:not(.crm-section-home) > table[width="100%"][border="1"] tr:nth-child(odd):not(:first-child) td,
.crm-module-page > font > center:not(.crm-section-home) > table[width="100%"][border="1"] tr:nth-child(odd):not(:first-child) td {
  background: #f5f8fb !important;
}

.crm-module-page > center:not(.crm-section-home) > table[width="100%"][border="1"] tr:hover:not(:first-child) td,
.crm-module-page > font > center:not(.crm-section-home) > table[width="100%"][border="1"] tr:hover:not(:first-child) td {
  background: #edf4fa !important;
}

@media (max-width: 980px) {
  .crm-pm-filters {
    grid-template-columns: 1fr 1fr;
  }
  .crm-pm-filters button {
    min-height: 44px;
  }
  .crm-pm-table {
    min-width: 1100px;
  }
  .crm-pm-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .crm-pm-filters {
    grid-template-columns: 1fr;
  }
  .crm-pm-summary {
    grid-template-columns: 1fr;
  }
}

/* Main intranet menu: horizontal navigation below the production bar */
.crm-top-horizontal {
  margin: 0;
  padding: 8px 14px;
  overflow: hidden;
  background: #e5ebf2;
  font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
}

.crm-top-horizontal.crm-horizontal-menu-open { overflow: visible; }

.crm-top-horizontal.crm-horizontal-menu-open > font,
.crm-top-horizontal.crm-horizontal-menu-open > font > table,
.crm-top-horizontal.crm-horizontal-menu-open > table,
.crm-top-horizontal.crm-horizontal-menu-open table table,
.crm-top-horizontal.crm-horizontal-menu-open table table td.crm-menu-section,
.crm-top-horizontal.crm-horizontal-menu-open .crm-menu-section > font {
  overflow: visible !important;
}

.crm-top-horizontal > font {
  display: block;
  width: 100%;
}

.crm-top-horizontal > font > table,
.crm-top-horizontal > table {
  width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.crm-top-horizontal > font > table > tbody > tr,
.crm-top-horizontal > table > tbody > tr {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 72px;
  align-items: start;
  gap: 8px;
}

.crm-top-horizontal > font > table > tbody > tr > td,
.crm-top-horizontal > table > tbody > tr > td {
  display: block;
  width: auto !important;
  min-width: 0;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  text-align: center !important;
  vertical-align: top !important;
}

.crm-top-horizontal > font > table > tbody > tr > td:first-child,
.crm-top-horizontal > table > tbody > tr > td:first-child {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
}

.crm-top-horizontal > font > table > tbody > tr > td:first-child > br,
.crm-top-horizontal > table > tbody > tr > td:first-child > br { display: none; }

.crm-top-horizontal > font > table > tbody > tr > td:first-child > a:first-child,
.crm-top-horizontal > table > tbody > tr > td:first-child > a:first-child {
  display: block !important;
  width: 42px !important;
  min-height: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.crm-top-horizontal img[src*="/media/utenti/"] {
  display: block;
  width: 40px !important;
  height: 46px !important;
  margin: 0;
  border-radius: 4px;
  object-fit: cover;
}

.crm-top-horizontal .crm-session-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  width: 100%;
  min-width: 0;
}

.crm-top-horizontal .crm-old-crm-button {
  display: flex !important;
  width: 100% !important;
  min-height: 38px !important;
  margin: 0 !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid #40556a !important;
  border-radius: 4px !important;
  padding: 6px 8px !important;
  background: #40556a !important;
  color: #fff !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  text-align: center !important;
  text-decoration: none !important;
  text-transform: uppercase;
}

.crm-top-horizontal .crm-logout-button {
  display: flex !important;
  min-height: 38px !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid #a73434 !important;
  border-radius: 4px !important;
  padding: 6px !important;
  background: #b73b3b !important;
  color: #fff !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  text-transform: uppercase;
}

.crm-top-horizontal .crm-logout-button:hover,
.crm-top-horizontal .crm-logout-button:focus {
  background: #922f2f !important;
  color: #fff !important;
}

.crm-top-horizontal table table {
  width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent !important;
  box-shadow: none !important;
  table-layout: fixed;
}

.crm-top-horizontal table table > tbody > tr {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
}

.crm-top-horizontal table table td.crm-menu-section {
  position: relative;
  display: block;
  flex: 1 1 0;
  width: auto !important;
  min-width: 105px;
  max-width: 180px;
  margin: 0;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: left !important;
}

.crm-top-horizontal .crm-menu-section > font { display: block; }

.crm-top-horizontal .crm-menu-section-toggle {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  min-height: 50px;
  margin: 0;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid #9cafbe;
  border-radius: 4px;
  padding: 8px 24px 8px 10px;
  background: #fff;
  color: #254257;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.crm-top-horizontal .crm-menu-section-toggle::after {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border-right: 2px solid #526d80;
  border-bottom: 2px solid #526d80;
  content: "";
  transform: rotate(45deg);
  transition: transform .16s ease;
}

.crm-top-horizontal .crm-menu-section-toggle:hover,
.crm-top-horizontal .crm-menu-section-toggle:focus,
.crm-top-horizontal .crm-menu-section.is-open .crm-menu-section-toggle {
  outline: 0;
  border-color: #27668e;
  background: #eaf3f8;
  color: #174b6b;
}

.crm-top-horizontal .crm-menu-section.is-open .crm-menu-section-toggle::after {
  margin-top: -1px;
  transform: rotate(225deg);
}

.crm-top-horizontal .crm-menu-section-panel {
  position: absolute;
  z-index: 100;
  top: calc(100% + 7px);
  left: 50%;
  display: block;
  visibility: hidden;
  width: 310px;
  max-height: 470px;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  border: 1px solid #8fa6b7;
  border-radius: 4px;
  padding: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(25, 47, 65, .24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -9px) scale(.985);
  transform-origin: top center;
  transition: opacity .18s ease, transform .23s cubic-bezier(.2, .72, .25, 1), visibility 0s linear .23s;
}

.crm-top-horizontal .crm-menu-section:first-child .crm-menu-section-panel {
  left: 0;
  transform: translateY(-9px) scale(.985);
  transform-origin: top left;
}

.crm-top-horizontal .crm-menu-section:last-child .crm-menu-section-panel,
.crm-top-horizontal .crm-menu-section:nth-last-child(2) .crm-menu-section-panel {
  right: 0;
  left: auto;
  transform: translateY(-9px) scale(.985);
  transform-origin: top right;
}

.crm-top-horizontal .crm-menu-section.is-open .crm-menu-section-panel {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
  transition-delay: 0s;
}

.crm-top-horizontal .crm-menu-section:first-child.is-open .crm-menu-section-panel,
.crm-top-horizontal .crm-menu-section:last-child.is-open .crm-menu-section-panel,
.crm-top-horizontal .crm-menu-section:nth-last-child(2).is-open .crm-menu-section-panel {
  transform: translateY(0) scale(1);
}
.crm-top-horizontal .crm-menu-section-panel br { display: none; }

.crm-top-horizontal .crm-menu-section-panel a {
  display: flex !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 35px;
  margin: 0 !important;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  border: 0 !important;
  border-bottom: 1px solid #dbe5ec !important;
  border-radius: 0 !important;
  padding: 7px 9px !important;
  background: #fff !important;
  color: #273f50 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1.25 !important;
  text-align: left !important;
  text-decoration: none !important;
  text-transform: uppercase;
  white-space: normal;
}

.crm-top-horizontal .crm-menu-section-panel a:nth-of-type(even) {
  background: #edf4f8 !important;
}

.crm-top-horizontal .crm-menu-section-panel a:last-of-type {
  border-bottom: 0 !important;
}

.crm-top-horizontal .crm-menu-section-panel a:hover,
.crm-top-horizontal .crm-menu-section-panel a:focus {
  outline: 0;
  border-color: #b8ccda !important;
  background: #edf5f9 !important;
  color: #174b6b !important;
}

.crm-top-horizontal .crm-menu-subsection {
  display: block;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #c6d7e2;
  background: #f4f8fb;
}

.crm-top-horizontal .crm-menu-subsection > summary {
  position: relative;
  display: flex;
  min-height: 38px;
  align-items: center;
  box-sizing: border-box;
  padding: 8px 30px 8px 10px;
  color: #173f5d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  list-style: none;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.crm-top-horizontal .crm-menu-subsection > summary::-webkit-details-marker { display: none; }

.crm-top-horizontal .crm-menu-subsection > summary::after {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border-right: 2px solid #47677d;
  border-bottom: 2px solid #47677d;
  content: "";
  transform: rotate(45deg);
  transition: transform .16s ease;
}

.crm-top-horizontal .crm-menu-subsection[open] > summary {
  background: #dfeef7;
  color: #124d73;
}

.crm-top-horizontal .crm-menu-subsection[open] > summary::after {
  margin-top: -1px;
  transform: rotate(225deg);
}

.crm-top-horizontal .crm-menu-subsection-panel {
  padding: 0 0 5px 13px;
  border-top: 1px solid #c8d9e4;
  background: #f8fbfd;
}

.crm-top-horizontal .crm-menu-subsection-panel a {
  min-height: 34px !important;
  border-left: 3px solid #6d9cb9 !important;
  background: #f8fbfd !important;
  font-size: 11px !important;
}

.crm-top-horizontal .crm-menu-subsection-panel a:nth-of-type(even) {
  background: #eaf3f8 !important;
}

.crm-top-horizontal .crm-top-badge {
  flex: 0 0 auto;
  margin-left: 7px;
}

.crm-top-horizontal > font > table > tbody > tr > td:last-child,
.crm-top-horizontal > table > tbody > tr > td:last-child {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  box-sizing: border-box;
  padding-right: 12px !important;
}

.crm-top-horizontal > font > table > tbody > tr > td:last-child > br,
.crm-top-horizontal > table > tbody > tr > td:last-child > br { display: none; }

.crm-top-horizontal > font > table > tbody > tr > td:last-child img,
.crm-top-horizontal > table > tbody > tr > td:last-child img {
  width: 34px !important;
  height: 34px !important;
}

.crm-top-horizontal .crm-legacy-logout-icon {
  display: flex !important;
  flex: 0 0 56px;
  width: 56px !important;
  min-height: 36px !important;
  height: 36px !important;
  margin: 0 !important;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-sizing: border-box;
  border: 1px solid #a73434 !important;
  border-radius: 4px !important;
  padding: 4px 5px !important;
  background: #fff !important;
  color: #a73434 !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  text-decoration: none !important;
}

.crm-top-horizontal .crm-legacy-logout-icon img {
  width: 20px !important;
  height: 20px !important;
  object-fit: contain;
}

.crm-top-horizontal .crm-legacy-logout-icon:hover,
.crm-top-horizontal .crm-legacy-logout-icon:focus {
  background: #fff1f1 !important;
  color: #842727 !important;
}

.crm-top-horizontal .crm-ferie-envelope,
.crm-top-horizontal .crm-alert-bell {
  display: flex !important;
  width: 34px !important;
  min-height: 34px !important;
  height: 34px !important;
  margin: 0 !important;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1200px) {
  .crm-top-horizontal { padding: 7px 10px; }
  .crm-top-horizontal > font > table > tbody > tr,
  .crm-top-horizontal > table > tbody > tr { grid-template-columns: 210px minmax(0, 1fr) 64px; gap: 6px; }
  .crm-top-horizontal table table > tbody > tr { display: flex; gap: 4px; }
  .crm-top-horizontal table table td.crm-menu-section { min-width: 0; max-width: none; }
  .crm-top-horizontal .crm-menu-section-toggle { min-height: 50px; padding: 6px 18px 6px 5px; font-size: 10px; }
  .crm-top-horizontal .crm-menu-section-toggle::after { right: 7px; }
}

@media (max-width: 760px) {
  .crm-top-horizontal { padding: 6px 8px; }
  .crm-top-horizontal > font > table > tbody > tr,
  .crm-top-horizontal > table > tbody > tr { grid-template-columns: 1fr 62px; gap: 6px; }
  .crm-top-horizontal > font > table > tbody > tr > td:first-child,
  .crm-top-horizontal > table > tbody > tr > td:first-child {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
  }
  .crm-top-horizontal > font > table > tbody > tr > td:first-child > a:first-child,
  .crm-top-horizontal > table > tbody > tr > td:first-child > a:first-child { display: none !important; }
  .crm-top-horizontal .crm-session-actions { width: min(100%, 330px); }
  .crm-top-horizontal .crm-old-crm-button,
  .crm-top-horizontal .crm-logout-button { min-height: 32px !important; }
  .crm-top-horizontal table table > tbody > tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-top-horizontal .crm-menu-section-toggle { min-height: 45px; padding: 6px 17px 6px 5px; font-size: 9px; }
  .crm-top-horizontal .crm-menu-section-toggle::after { right: 7px; width: 6px; height: 6px; }
  .crm-top-horizontal .crm-menu-section-panel,
  .crm-top-horizontal .crm-menu-section:first-child .crm-menu-section-panel,
  .crm-top-horizontal .crm-menu-section:last-child .crm-menu-section-panel,
  .crm-top-horizontal .crm-menu-section:nth-last-child(2) .crm-menu-section-panel {
    position: fixed;
    top: 142px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: 490px;
    transform: translateY(-9px) scale(.99);
    transform-origin: top center;
  }
  .crm-top-horizontal .crm-menu-section.is-open .crm-menu-section-panel,
  .crm-top-horizontal .crm-menu-section:first-child.is-open .crm-menu-section-panel,
  .crm-top-horizontal .crm-menu-section:last-child.is-open .crm-menu-section-panel,
  .crm-top-horizontal .crm-menu-section:nth-last-child(2).is-open .crm-menu-section-panel {
    transform: translateY(0) scale(1);
  }
}
