/* Design tokens allineati a hawkings-app-figma (globals.css) */
:root {
  --font-size: 20px;
  --radius: 34px;
  --background: #ffffff;
  --foreground: #030213;
  --primary: #030213;
  --primary-foreground: #ffffff;
  --muted: #ececf0;
  --muted-foreground: #717182;
  --border: rgba(0, 0, 0, 0.1);
  --input-background: #f3f3f5;
  --accent: #e9ebef;
  --card: #ffffff;
  --sidebar: #fafafa;
  --sidebar-border: #ebebef;
  --destructive: #d4183d;
  --surface: #f9fafb;
  --border-light: #d1d5db;
  --ai-bubble-bg: #eff6ff;
  --ai-bubble-border: #bfdbfe;
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("figtree-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("figtree-italic.woff2") format("woff2");
}

html {
  font-size: 20px;
  font-family: "Figtree", sans-serif;
}

.pagina {
  margin: 0;
  min-height: 100vh;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 20px;
  background-color: var(--card);
  color: var(--foreground);
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.skip-link:focus {
  left: 0;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.auth-schermata {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000;
  color: #ffffff;
}

.auth-box {
  width: 420px;
  margin-left: auto;
  margin-right: auto;
  color: #ffffff;
}

.auth-logo-wrap {
  text-align: center;
  margin-bottom: 48px;
}

.auth-logo {
  height: 36px;
  margin-left: auto;
  margin-right: auto;
  display: block;
  object-fit: contain;
}

.auth-schermata .auth-logo {
  filter: brightness(0) invert(1);
}

.login-titolo-wrap,
.signup-titolo-wrap,
.reset-titolo-wrap,
.reset-confirm-titolo-wrap {
  margin-bottom: 40px;
  color: #ffffff;
}

.login-titolo,
.signup-titolo,
.reset-titolo,
.reset-confirm-titolo,
.reset-grazie-titolo,
.reset-invalido-titolo {
  text-align: center;
  margin-bottom: 12px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 600;
}

.reset-grazie-titolo {
  margin-bottom: 20px;
}

.login-sottotitolo,
.signup-sottotitolo,
.reset-sottotitolo,
.reset-confirm-sottotitolo,
.reset-invalido-sottotitolo {
  text-align: center;
  font-size: 20px;
  color: #697484;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-campo-wrap {
  margin-bottom: 20px;
}

.auth-label {
  display: block;
  font-size: 20px;
  color: #ffffff;
  margin-bottom: 8px;
}

.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: #ffffff;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius);
  box-sizing: border-box;
}

.auth-input::placeholder {
  color: #697484;
}

.login-bottone-invia,
.signup-bottone-invia,
.reset-bottone-invia,
.reset-confirm-bottone-invia {
  margin-top: 32px;
  width: 100%;
  height: 48px;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: #000000;
  background-color: var(--card);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.reset-bottone-invia {
  margin-top: 20px;
}

.reset-confirm-bottone-invia {
  margin-top: 20px;
}

.login-link-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.auth-link-reset {
  font-size: 20px;
  color: #697484;
  cursor: pointer;
  background: none;
  border: none;
  font-family: "Figtree", sans-serif;
  padding: 0;
}

.auth-link-reset:hover {
  text-decoration: underline;
}

.auth-separatore-wrap {
  display: flex;
  align-items: center;
  margin-top: 32px;
  margin-bottom: 32px;
}

.auth-separatore-linea {
  flex: 1;
  border-top: 0.5px solid #697484;
}

.auth-separatore-testo {
  padding-left: 16px;
  padding-right: 16px;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #697484;
  background-color: #000000;
}

.auth-bottone-google {
  width: 100%;
  height: 48px;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: #000000;
  background-color: var(--card);
  border: 1px solid #ffffff;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.auth-bottone-google-icon {
  width: 20px;
  height: 20px;
}

.auth-footer-wrap {
  text-align: center;
  margin-top: 28px;
}

.auth-footer-testo {
  font-size: 20px;
  color: #697484;
}

.auth-footer-link {
  color: #ffffff;
  cursor: pointer;
  background: none;
  border: none;
  font-family: "Figtree", sans-serif;
  font-weight: 500;
  padding: 0;
  text-decoration: none;
}

.auth-footer-link:hover {
  text-decoration: underline;
}

.auth-footer-legal {
  margin-top: 16px;
}

.auth-footer-link-inline {
  color: var(--muted-foreground);
  text-decoration: none;
}

.auth-footer-link-inline:hover {
  color: var(--border-light);
  text-decoration: underline;
}

.auth-footer-sep {
  margin: 0 6px;
  color: var(--muted-foreground);
}

.auth-bottone-indietro {
  margin-top: 24px;
  width: 100%;
  height: 48px;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: #ffffff;
  background-color: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-bottone-indietro:hover {
  background-color: #1a1a1a;
}

.auth-bottone-indietro-icon {
  width: 16px;
  height: 16px;
}

.auth-bottone-torna {
  width: 100%;
  height: 48px;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: #000000;
  background-color: var(--card);
  border: 1px solid #ffffff;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-bottone-torna-icon {
  width: 16px;
  height: 16px;
}

.auth-bottone-torna {
  text-decoration: none;
  box-sizing: border-box;
}

.reset-messaggio-box {
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 32px;
}

.reset-messaggio-testo {
  font-size: 20px;
  color: #717182;
  margin-top: 12px;
}

.reset-messaggio-testo-primo {
  margin-top: 0;
}

.reset-messaggio-evidenziato {
  font-weight: 700;
  color: #f1f1f1;
}

.reset-messaggio-link {
  color: #f1f1f1;
  font-weight: 700;
  font-size: 20px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: "Figtree", sans-serif;
  padding: 0;
  text-decoration: underline;
}

.reset-messaggio-link:hover {
  text-decoration: none;
}

.signup-checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding-top: 8px;
}

.signup-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #000000;
  cursor: pointer;
}

.signup-checkbox-label {
  font-size: 20px;
  color: #ffffff;
  cursor: pointer;
  line-height: 1.5;
  flex: 1;
}

.signup-checkbox-label-link {
  color: #ffffff;
  cursor: pointer;
  background: none;
  border: none;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  padding: 0;
}

.signup-checkbox-label-link:hover {
  text-decoration: underline;
}

a.signup-checkbox-label-link {
  text-decoration: none;
}

.auth-errore {
  font-size: 20px;
  color: #e57373;
  margin-bottom: 16px;
}

.auth-errore-nascondi {
  display: none;
}

.login-bottone-invia:disabled,
.signup-bottone-invia:disabled,
.reset-bottone-invia:disabled,
.reset-confirm-bottone-invia:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.index-welcome-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.index-welcome-testo {
  font-size: 20px;
  color: #ffffff;
}

/* Sidebar: aperta 260px, chiusa 64px. Toggle 32px, centro sul bordo = width - 16px */
.app-wrap {
  display: flex;
  height: 100vh;
  background-color: var(--surface);
  --sidebar-width: 260px;
}

.app-wrap.sidebar-collapsed {
  --sidebar-width: 64px;
}

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  background-color: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
  overflow: visible;
  box-sizing: border-box;
  z-index: 40;
  position: relative;
}

.app-wrap.sidebar-collapsed .sidebar {
  overflow-x: hidden;
}

.app-wrap.sidebar-collapsing .sidebar {
  transition-duration: 0.3s;
}

/* In chiusura il testo scompare con un leggero ritardo e più gradualmente */
.app-wrap.sidebar-collapsing.sidebar-collapsed .sidebar-logo-text,
.app-wrap.sidebar-collapsing.sidebar-collapsed .sidebar-nav-label,
.app-wrap.sidebar-collapsing.sidebar-collapsed .sidebar-footer .sidebar-nav-label,
.app-wrap.sidebar-collapsing.sidebar-collapsed .sidebar-account-email,
.app-wrap.sidebar-collapsing.sidebar-collapsed .sidebar-esci-link {
  transition-duration: 0.28s;
  transition-delay: 0.06s;
}

.sidebar-toggle-btn {
  position: fixed;
  left: calc(var(--sidebar-width) - 16px);
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--sidebar-border);
  background-color: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: left 0.2s ease, background-color 0.15s, border-color 0.15s;
}

.sidebar-toggle-btn:hover {
  background-color: #f3f4f6;
  border-color: var(--border-light);
}

.sidebar-toggle-arrow {
  width: 20px;
  height: 20px;
  color: var(--foreground);
  transition: transform 0.2s ease;
}

.app-wrap.sidebar-collapsed .sidebar-toggle-arrow {
  transform: rotate(180deg);
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-shrink: 0;
}

.app-wrap.sidebar-collapsing .sidebar-header {
  overflow: hidden;
}

/* Sposta il logo a destra per allineare il centro con le icone nav (centro icone = 12 + 10 = 22px) */
.sidebar-logo-link {
  margin-left: 6px;
  transition: margin-left 0.25s ease, gap 0.25s ease, width 0.25s ease, justify-content 0.25s ease;
}

.sidebar-logo-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  transition: width 0.25s ease, flex 0.25s ease;
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  line-height: 0;
}

.sidebar-logo-text {
  font-family: "Figtree", sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--foreground);
}

.sidebar-logo {
  height: 28px;
  width: 28px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

/*
  Sidebar chiusa: 64px totali.
  Margine 12px a sinistra e destra → area centrale 40px (12+40+12=64).
  Icone 20px → centrate in 40px con padding 10px (10+20+10=40).
  Logo 28px → centrato in 40px (6+28+6=40).
  OGNI figlio diretto di nav/footer deve essere 40px e centrato.
*/
.app-wrap.sidebar-collapsed .sidebar-header {
  padding: 20px 12px;
  justify-content: center;
}

.app-wrap.sidebar-collapsed .sidebar-logo-wrap {
  flex: none;
  width: 40px;
  justify-content: center;
}

.app-wrap.sidebar-collapsed .sidebar-logo-link {
  margin-left: 0;
  width: 40px;
  justify-content: center;
  gap: 0;
}

.app-wrap.sidebar-collapsed .sidebar-logo-text {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  min-width: 0;
  transition: opacity 0.2s ease, max-width 0.25s ease;
}

.sidebar-logo-text {
  max-width: 200px;
  transition: opacity 0.15s ease, max-width 0.2s ease;
}

.app-wrap.sidebar-collapsed .sidebar-nav {
  padding: 12px 12px 8px 12px;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-wrap.sidebar-collapsed .sidebar-nav::-webkit-scrollbar {
  display: none;
}

/* I figli della nav sono: <a> diretti O <div.sidebar-nav-parent>. Entrambi devono essere 40px. */
.app-wrap.sidebar-collapsed .sidebar-nav-parent {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  flex-shrink: 0;
  justify-content: center;
}

.app-wrap.sidebar-collapsed .sidebar-nav-item,
.app-wrap.sidebar-collapsed .sidebar-nav-parent .sidebar-nav-item {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  flex: none;
  justify-content: center;
  align-items: center;
  padding: 10px;
  gap: 0;
  box-sizing: border-box;
}

.sidebar-nav-label {
  max-width: 180px;
  min-width: 0;
  transition: opacity 0.2s ease, max-width 0.25s ease;
}

.app-wrap.sidebar-collapsed .sidebar-nav-label {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
}

.app-wrap.sidebar-collapsed .sidebar-nav-sub,
.app-wrap.sidebar-collapsed .sidebar-nav-group-label,
.app-wrap.sidebar-collapsed .sidebar-nav-divider {
  display: none;
}

.app-wrap.sidebar-collapsed .sidebar-footer .sidebar-nav-label,
.app-wrap.sidebar-collapsed .sidebar-account-email,
.app-wrap.sidebar-collapsed .sidebar-esci-link {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  min-width: 0;
  transition: opacity 0.2s ease, max-width 0.25s ease;
}

.sidebar-footer .sidebar-nav-label,
.sidebar-account-email,
.sidebar-esci-link {
  max-width: 200px;
  min-width: 0;
  transition: opacity 0.15s ease, max-width 0.2s ease;
}

.app-wrap.sidebar-collapsed .sidebar-footer {
  padding: 12px 12px 16px 12px;
  align-items: center;
}

.app-wrap.sidebar-collapsed .sidebar-footer-tool {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.app-wrap.sidebar-collapsed .sidebar-footer-item,
.app-wrap.sidebar-collapsed .sidebar-account-toggle {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  padding: 10px;
  gap: 0;
  box-sizing: border-box;
}

.app-wrap.sidebar-collapsed .sidebar-account-wrap {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  flex-shrink: 0;
  justify-content: center;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-nav-divider {
  height: 1px;
  background-color: var(--sidebar-border);
  margin: 8px 12px;
  border: none;
}

.sidebar-nav-group-label {
  padding: 8px 12px 4px;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius);
  background: none;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: var(--muted-foreground);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s, color 0.15s;
  text-decoration: none;
  box-sizing: border-box;
}

.sidebar-nav-item:hover {
  background-color: #f3f4f6;
  color: var(--foreground);
}

.sidebar-nav-item-active {
  background-color: var(--accent);
  color: var(--foreground);
  font-weight: 500;
}

.sidebar-nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav-parent {
  display: flex;
  align-items: center;
  width: 100%;
}

.sidebar-nav-parent .sidebar-nav-item {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.sidebar-nav-sub {
  margin-left: 12px;
  margin-top: 2px;
  margin-bottom: 6px;
  padding-left: 8px;
  border-left: 2px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  transition: opacity 0.2s;
}

.sidebar-nav-sub-collapsed {
  display: none;
}

.sidebar-nav-sub-item {
  display: block;
  padding: 6px 10px;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: var(--muted-foreground);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background-color 0.15s, color 0.15s;
}

.sidebar-nav-sub-item:hover {
  background-color: #f3f4f6;
  color: var(--foreground);
}

.sidebar-nav-sub-item-active {
  font-weight: 500;
  color: var(--foreground);
  background-color: var(--accent);
}

.sidebar-footer {
  padding: 12px 12px 16px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-footer-tool {
  margin-bottom: 4px;
}

.sidebar-footer-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius);
  background: none;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: #4b5563;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s, color 0.15s;
  text-decoration: none;
  box-sizing: border-box;
}

.sidebar-footer-item:hover {
  background-color: #f3f4f6;
  color: var(--foreground);
}

.sidebar-footer-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-account-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius);
  box-sizing: border-box;
}

.sidebar-account-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-account-email {
  font-size: 20px;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.sidebar-esci-link {
  font-size: 20px;
  color: #4b5563;
  cursor: pointer;
  background: none;
  border: none;
  font-family: "Figtree", sans-serif;
  padding: 0;
  margin-left: 4px;
}

.sidebar-esci-link:hover {
  color: var(--foreground);
  text-decoration: underline;
}

.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 24px;
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
}

.main-placeholder {
  font-size: 20px;
  color: var(--muted-foreground);
}

.assistente-home-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.assistente-titolo {
  font-size: 48px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 40px;
  text-align: center;
}

.crm-placeholder-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.crm-placeholder-titolo {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 12px;
}

.crm-placeholder-testo {
  font-size: 20px;
  color: var(--muted-foreground);
  max-width: 420px;
}

/* Bozze grafiche pagine CRM */
.crm-draft {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  text-align: left;
}

.crm-draft-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.crm-azienda-detail-page-header {
  width: 100%;
}
.crm-azienda-detail-page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.crm-azienda-detail-page-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.crm-azienda-detail-back {
  font-size: 24px;
  padding: 4px 0;
  line-height: 1;
}
.crm-azienda-detail-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}
.crm-azienda-detail-page-header-left .crm-draft-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-draft-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.crm-draft-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--foreground);
  background-color: var(--accent);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
}

.crm-draft-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.crm-draft-search {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  font-size: 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
}

.crm-draft-select {
  padding: 8px 12px;
  font-size: 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
}

.crm-draft-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--card);
}

.crm-draft-table-wrap + .crm-draft-pagination {
  border-top: 1px solid var(--border-light);
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: -1px;
}

.crm-draft-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 20px;
}

.crm-draft-table th,
.crm-draft-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.crm-draft-table th {
  font-weight: 600;
  color: var(--foreground);
  background: var(--surface);
}

.crm-draft-table tr:last-child td {
  border-bottom: none;
}

.crm-draft-table tbody tr:hover td {
  background: var(--surface);
}

.crm-draft-table tbody tr.crm-row-link {
  cursor: pointer;
}

.crm-aziende-block #crm-aziende-tbody td,
.crm-table-block .crm-draft-table tbody td {
  color: #374151;
}

.crm-aziende-block,
.crm-table-block {
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--card);
  overflow: hidden;
}

.crm-aziende-top-bar,
.crm-table-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--card);
}

.crm-aziende-top-bar-left,
.crm-table-top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crm-aziende-top-bar-left-actions,
.crm-table-top-bar-left-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-aziende-top-bar-title,
.crm-table-top-bar-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
}

.crm-aziende-selection-box,
.crm-table-selection-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 6px 0 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  font-size: 20px;
  color: var(--foreground);
}

.crm-aziende-selection-box[hidden],
.crm-table-selection-box[hidden] {
  display: none !important;
}

.crm-aziende-selection-count,
.crm-table-selection-count {
  white-space: nowrap;
}

.crm-aziende-selection-clear,
.crm-table-selection-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.crm-aziende-selection-clear:hover,
.crm-table-selection-clear:hover {
  background: var(--accent);
  color: var(--foreground);
}

.crm-aziende-top-bar-actions,
.crm-table-top-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-aziende-top-bar-actions .crm-draft-search,
.crm-table-top-bar-actions .crm-draft-search {
  width: 220px;
  min-width: 180px;
  height: 40px;
  margin: 0;
  padding: 0 14px;
  box-sizing: border-box;
  font-size: 20px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--card);
  color: var(--foreground);
}

.crm-table-top-bar-actions .crm-draft-select {
  height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  font-size: 20px;
}

.crm-aziende-top-bar-actions a.crm-aziende-top-bar-btn,
.crm-table-top-bar-actions a.crm-table-top-bar-btn {
  text-decoration: none;
}

.crm-aziende-top-bar-btn,
.crm-table-top-bar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border: none;
  border-radius: 20px;
  background: #000000;
  color: #ffffff;
  cursor: pointer;
  font-size: 20px;
  font-weight: 500;
  font-family: inherit;
  transition: min-width 0.25s ease, padding 0.25s ease, opacity 0.15s, gap 0.2s ease;
  overflow: hidden;
  box-sizing: border-box;
}

.crm-aziende-top-bar-btn:hover,
.crm-table-top-bar-btn:hover {
  opacity: 0.95;
  min-width: 120px;
  padding: 0 14px 0 10px;
  justify-content: flex-start;
  gap: 8px;
}

.crm-aziende-top-bar-btn img,
.crm-table-top-bar-btn img {
  display: block;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.crm-aziende-top-bar-btn-label,
.crm-table-top-bar-btn-label {
  max-width: 0;
  width: 0;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: max-width 0.25s ease, opacity 0.2s ease, width 0.2s ease;
}

.crm-aziende-top-bar-btn:hover .crm-aziende-top-bar-btn-label,
.crm-table-top-bar-btn:hover .crm-table-top-bar-btn-label {
  max-width: 100px;
  width: auto;
  min-width: 0;
  opacity: 1;
}

/* In anagrafica: solo Aggiungi (+) a fondo nero; altri pulsanti top bar: bianchi con icona/testo neri */
.crm-aziende-top-bar-btn.crm-top-bar-btn-outline,
.crm-table-top-bar-btn.crm-top-bar-btn-outline {
  background: #ffffff;
  color: #000000;
  border: 1px solid var(--border-light);
}

.crm-aziende-top-bar-btn.crm-top-bar-btn-outline img,
.crm-table-top-bar-btn.crm-top-bar-btn-outline img {
  filter: none;
}

.crm-aziende-top-bar-btn.crm-top-bar-btn-outline:hover,
.crm-table-top-bar-btn.crm-top-bar-btn-outline:hover {
  background: var(--surface);
  border-color: var(--muted-foreground);
}

.crm-aziende-block .crm-draft-table-wrap,
.crm-table-block .crm-draft-table-wrap {
  border: none;
  border-radius: 0;
  border-top: none;
}

.crm-aziende-block .crm-draft-pagination,
.crm-table-block .crm-draft-pagination {
  border: none;
  border-top: 1px solid var(--border-light);
  border-radius: 0;
}

.crm-aziende-block .crm-draft-table th,
.crm-table-block .crm-draft-table th {
  background: #f1f3f5;
}

.crm-aziende-block .crm-draft-table tbody tr:nth-child(odd) td,
.crm-table-block .crm-draft-table tbody tr:nth-child(odd) td {
  background: var(--card);
}

.crm-aziende-block .crm-draft-table tbody tr:nth-child(even) td,
.crm-table-block .crm-draft-table tbody tr:nth-child(even) td {
  background: var(--surface);
}

.crm-aziende-block .crm-draft-table tbody tr:hover td,
.crm-table-block .crm-draft-table tbody tr:hover td {
  background: var(--accent);
}

.crm-aziende-block .crm-draft-table-wrap + .crm-draft-pagination,
.crm-table-block .crm-draft-table-wrap + .crm-draft-pagination {
  border-radius: 0 0 20px 20px;
}

.crm-draft-table-th-check,
.crm-draft-table-td-check {
  width: 44px;
  min-width: 44px;
  text-align: center;
  vertical-align: middle;
}

.crm-draft-table-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.crm-draft-list-item.crm-row-link {
  cursor: pointer;
}

.crm-evento-day-block.crm-row-link {
  cursor: pointer;
}

.crm-draft-calendar-day-event.crm-row-link {
  cursor: pointer;
}

.crm-draft-back {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 20px;
  color: var(--muted-foreground);
  text-decoration: none;
}
.crm-draft-back:hover {
  color: var(--foreground);
  text-decoration: underline;
}

.crm-detail-fields {
  margin-bottom: 24px;
}
.crm-detail-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.crm-detail-row:last-child {
  border-bottom: none;
}
.crm-detail-label {
  font-weight: 500;
  color: var(--muted-foreground);
  min-width: 140px;
}
.crm-detail-value {
  color: var(--foreground);
}

/* Layout dettaglio azienda: 2 colonne (2/3 + 1/3) */
.crm-azienda-detail-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .crm-azienda-detail-layout {
    grid-template-columns: 1fr;
  }
}
.crm-azienda-detail-panel-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.crm-azienda-detail-panel-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.crm-azienda-detail-scheda {
  flex-shrink: 0;
}
.crm-azienda-detail-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}
.crm-azienda-detail-card-title {
  margin: 0;
  padding: 12px 16px;
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}
.crm-azienda-detail-card-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}
.crm-azienda-detail-card-header-row .crm-azienda-detail-card-title {
  margin: 0;
  padding: 0;
  border-bottom: none;
  flex: 1;
  min-width: 0;
}
.crm-azienda-detail-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.crm-azienda-detail-card-toggle {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--muted-foreground);
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
}
.crm-azienda-detail-card-toggle:hover {
  color: var(--foreground);
  background: var(--surface);
}
.crm-azienda-detail-card-collapsed .crm-azienda-detail-card-body {
  display: none;
}
.crm-azienda-detail-card-collapsed .crm-azienda-detail-card-toggle {
  font-size: 22px;
}
.crm-azienda-contatti-add-btn {
  flex-shrink: 0;
  font-size: 18px;
  padding: 6px 12px;
}
.crm-azienda-detail-card-body {
  padding: 16px;
}
.crm-azienda-detail-card-body .crm-detail-fields {
  margin-bottom: 0;
}
.crm-azienda-detail-tab-placeholder {
  color: var(--muted-foreground);
  font-size: 20px;
}
.crm-azienda-contatti-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.crm-azienda-contatti-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 20px;
}
.crm-azienda-contatti-list li:last-child {
  border-bottom: none;
}
.crm-azienda-contatti-list li a.crm-azienda-contatto-link {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 2px 0;
}
.crm-azienda-contatti-list li a.crm-azienda-contatto-link:hover {
  color: var(--foreground);
}
.crm-azienda-contatti-list .contatto-nome {
  font-weight: 500;
  color: var(--foreground);
}
.crm-azienda-contatti-list .contatto-dettaglio {
  display: block;
  font-size: 18px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.crm-draft-table a {
  color: var(--foreground);
  text-decoration: none;
}

.crm-draft-table a:hover {
  text-decoration: underline;
}

.crm-draft-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.crm-draft-loading {
  grid-column: 1 / -1;
  color: var(--muted-foreground);
  margin: 0;
}

.crm-draft-loading-nascondi {
  display: none;
}

.crm-draft-error {
  grid-column: 1 / -1;
  color: #dc2626;
  margin: 0;
}

.crm-draft-card {
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.crm-draft-card:hover {
  border-color: var(--muted-foreground);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.crm-draft-card-title {
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 6px;
}

.crm-draft-card-meta {
  font-size: 20px;
  color: var(--muted-foreground);
}

.crm-draft-form {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.crm-draft-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crm-draft-field label {
  font-size: 20px;
  font-weight: 500;
  color: var(--foreground);
}

.crm-draft-field input,
.crm-draft-field select,
.crm-draft-field textarea {
  padding: 8px 12px;
  font-size: 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
}

/* Toggle (switch) nel form CRM */
.crm-draft-field-toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crm-draft-toggle-label {
  font-size: 20px;
  font-weight: 500;
  color: var(--foreground);
}

.crm-draft-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.crm-draft-toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.crm-draft-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-light);
  border-radius: 34px;
  transition: background-color 0.2s ease;
}

.crm-draft-toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.crm-draft-toggle-input:focus-visible + .crm-draft-toggle-slider {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.crm-draft-toggle-input:checked + .crm-draft-toggle-slider {
  background-color: var(--primary);
}

.crm-draft-toggle-input:checked + .crm-draft-toggle-slider::before {
  transform: translateX(20px);
}

.crm-draft-calendar {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.crm-draft-calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 20px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
}

.crm-draft-calendar-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.crm-draft-calendar-day {
  min-height: 80px;
  padding: 8px;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  font-size: 20px;
}

.crm-draft-calendar-day:nth-child(7n) {
  border-right: none;
}

.crm-draft-calendar-day-num {
  color: var(--muted-foreground);
  margin-bottom: 4px;
}

.crm-draft-calendar-day-event {
  font-size: 20px;
  padding: 2px 6px;
  background: var(--accent);
  border-radius: 34px;
  margin-top: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-draft-calendar-day-other {
  background: var(--surface);
}

.crm-draft-calendar-day-other .crm-draft-calendar-day-num {
  visibility: hidden;
}

.crm-draft-calendar-day[data-date] {
  cursor: pointer;
}

.crm-draft-calendar-day[data-date]:hover {
  background: var(--surface);
}

.crm-draft-calendar-day-more {
  font-size: 16px;
  color: var(--muted-foreground);
  margin-top: 4px;
  padding: 0 6px;
}

.crm-draft-calendar-mese {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.crm-draft-calendar-mese .crm-draft-calendar-body {
  flex: 1;
  min-height: 200px;
}

.main-content.main-content-calendario {
  overflow: hidden;
}

.main-content-calendario .crm-draft {
  max-width: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.attivita-calendario-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Un solo pannello visibile per vista (giorno / mese / anno) */
.attivita-calendario-wrap.attivita-view-giorno .attivita-panel-mese,
.attivita-calendario-wrap.attivita-view-giorno .attivita-panel-anno,
.attivita-calendario-wrap.attivita-view-mese .attivita-panel-giorno,
.attivita-calendario-wrap.attivita-view-mese .attivita-panel-anno,
.attivita-calendario-wrap.attivita-view-anno .attivita-panel-giorno,
.attivita-calendario-wrap.attivita-view-anno .attivita-panel-mese {
  display: none !important;
}
.attivita-calendario-wrap.attivita-view-giorno .attivita-panel-giorno {
  display: flex;
}
.attivita-calendario-wrap.attivita-view-mese .attivita-panel-mese {
  display: flex;
}
.attivita-calendario-wrap.attivita-view-anno .attivita-panel-anno {
  display: flex;
}

.attivita-panel[hidden] {
  display: none !important;
}

.attivita-panel-giorno {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.attivita-panel-mese,
.attivita-panel-anno {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.attivita-panel-giorno .crm-draft-calendar {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Riga alta calendario: giorno a sx, 3 tab al centro, + a dx */
.calendario-top-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.calendario-top-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  flex-shrink: 0;
}
.calendario-nav-toggle {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}
.calendario-nav-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: 20px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--card);
  border: 1px solid var(--border-light);
  margin-left: -1px;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.calendario-nav-toggle-btn:first-child {
  margin-left: 0;
  border-radius: var(--radius) 0 0 var(--radius);
}
.calendario-nav-toggle-btn:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}
.calendario-nav-toggle-btn:hover {
  color: var(--foreground);
  background: var(--surface);
}
.calendario-nav-toggle-btn img {
  display: block;
}
.calendario-view-toggle {
  display: flex;
  align-items: stretch;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}
.calendario-view-tab {
  padding: 8px 20px;
  font-size: 20px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--card);
  border: 1px solid var(--border-light);
  margin-left: -1px;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.calendario-view-tab:first-child {
  margin-left: 0;
  border-radius: var(--radius) 0 0 var(--radius);
}
.calendario-view-tab:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}
.calendario-view-tab:hover {
  color: var(--foreground);
  background: var(--surface);
}
.calendario-view-tab-active {
  color: var(--foreground);
  background: var(--surface);
  z-index: 1;
}
.calendario-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--foreground);
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.calendario-add-btn:hover {
  background: var(--surface);
  border-color: var(--muted-foreground);
}
.calendario-add-btn img {
  display: block;
}
.calendario-giorno-scheda {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border-light);
  border-radius: 0;
  background: var(--card);
  overflow: hidden;
}
.calendario-giorno-scheda .crm-draft-calendar {
  flex: 1;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}
.calendario-giorno-scheda .crm-day-timeline {
  border: none;
  border-radius: 0;
}
.calendario-nav-row {
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.attivita-view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
}

.attivita-view-tab {
  padding: 8px 16px;
  font-size: 20px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.attivita-view-tab:hover {
  color: var(--foreground);
  background: var(--surface);
}

.attivita-view-tab-active {
  color: var(--foreground);
  background: var(--card);
  border-color: var(--border-light);
}


.crm-draft-calendar-wide {
  min-width: 0;
  width: 100%;
}

.crm-draft-calendar-anno {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  overflow: auto;
}

.crm-draft-calendar-anno-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}

@media (max-width: 900px) {
  .crm-draft-calendar-anno-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .crm-draft-calendar-anno-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.crm-draft-calendar-anno-mese {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.crm-draft-calendar-anno-mese-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted-foreground);
  padding: 6px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.crm-draft-calendar-anno-header {
  padding: 2px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.crm-draft-calendar-anno-mese-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(14px, 1fr);
  gap: 1px;
  padding: 4px;
  flex: 1;
  min-height: 0;
}

.crm-cal-anno-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  min-height: 0;
  color: var(--foreground);
  cursor: pointer;
  border-radius: 2px;
}

.crm-cal-anno-day:hover {
  background: var(--surface);
  color: var(--foreground);
}

.crm-cal-anno-day-pad {
  cursor: default;
  color: transparent;
  pointer-events: none;
}

.crm-cal-anno-day-has-events {
  font-weight: 600;
  color: var(--accent);
}

.crm-draft-list {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.crm-draft-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 20px;
}

.crm-draft-list-item:last-child {
  border-bottom: none;
}

.crm-draft-list-item:hover {
  background: var(--surface);
}

.crm-draft-list-item-unread {
  font-weight: 500;
}

.crm-draft-list-item-meta {
  color: var(--muted-foreground);
  font-size: 20px;
}

.crm-draft-tool-result {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: monospace;
  font-size: 20px;
  color: var(--foreground);
}

.crm-draft-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 20px;
  font-weight: 500;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--foreground);
}

.crm-draft-btn-secondary {
  background: transparent;
  color: var(--muted-foreground);
}

.crm-draft-btn-secondary:hover {
  background: var(--surface);
  color: var(--foreground);
}

.crm-draft-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.crm-draft-tab {
  padding: 10px 16px;
  font-size: 20px;
  font-weight: 500;
  color: var(--muted-foreground);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
}

.crm-draft-tab:hover {
  color: var(--foreground);
}

.crm-draft-tab-active {
  color: var(--foreground);
  border-bottom-color: var(--foreground);
}

.crm-draft-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.crm-draft-nav-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
}

.crm-draft-nav-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-draft-nav-btn {
  padding: 6px 12px;
  font-size: 20px;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
}

.crm-draft-nav-btn:hover {
  background: var(--surface);
}

/* Timeline vista giorno: colonna ore + blocchi evento; riempie lo spazio fino a fine pagina */
.crm-day-timeline {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border-light);
  border-radius: 0;
  background: var(--card);
  overflow: hidden;
}
.crm-day-timeline-hours {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-light);
  background: var(--surface);
  min-height: 0;
}
.crm-day-timeline-hour {
  flex: 1;
  min-height: 0;
  padding: 4px 8px 0 0;
  text-align: right;
  font-size: 18px;
  font-weight: 500;
  color: var(--muted-foreground);
  line-height: 1;
  box-sizing: border-box;
}
.crm-day-timeline-events {
  position: relative;
  flex: 1;
  min-height: 0;
}
.crm-day-timeline-events-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.crm-day-event-block {
  position: absolute;
  left: 8px;
  right: 8px;
  box-sizing: border-box;
  padding: 6px 10px;
  overflow: hidden;
  min-height: 28px;
  background: var(--accent);
  border: 1px solid var(--border-light);
  border-radius: 0;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.15s, border-color 0.15s;
}
.crm-day-event-block:hover {
  background: var(--surface);
  border-color: var(--muted-foreground);
}
.crm-day-event-block-title {
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-day-event-block-time {
  font-size: 16px;
  color: var(--muted-foreground);
  margin-top: 2px;
}
.crm-day-event-block-desc {
  font-size: 16px;
  color: var(--muted-foreground);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.crm-draft-day-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  align-items: start;
  font-size: 20px;
}

.crm-draft-day-row:last-child {
  border-bottom: none;
}

.crm-draft-day-row:hover {
  background: var(--surface);
}

.crm-draft-day-time {
  font-weight: 500;
  color: var(--muted-foreground);
}

.crm-draft-day-event-title {
  font-weight: 500;
  color: var(--foreground);
}

.crm-draft-day-event-desc {
  font-size: 20px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.crm-draft-table .crm-draft-table-tfoot td {
  font-weight: 600;
  background: var(--surface);
  border-top: 2px solid var(--border-light);
}

.crm-draft-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--card);
  font-size: 20px;
  color: var(--muted-foreground);
}

.crm-draft-pagination-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.crm-draft-pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.crm-draft-pagination-ellipsis {
  padding: 0 4px;
  font-size: 20px;
  color: var(--muted-foreground);
  user-select: none;
}

.crm-draft-pagination-btn {
  padding: 6px 10px;
  font-size: 20px;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
}

.crm-aziende-block .crm-draft-pagination .crm-draft-pagination-btn,
.crm-table-block .crm-draft-pagination .crm-draft-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border: none;
  border-radius: 20px;
  background: #000000;
  color: #ffffff;
  font-size: 20px;
  font-weight: 500;
}

.crm-aziende-block .crm-draft-pagination .crm-draft-pagination-btn:hover:not(:disabled),
.crm-table-block .crm-draft-pagination .crm-draft-pagination-btn:hover:not(:disabled) {
  opacity: 0.85;
  background: #000000;
}

.crm-aziende-block .crm-draft-pagination .crm-draft-pagination-btn:disabled,
.crm-table-block .crm-draft-pagination .crm-draft-pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #000000;
}

.crm-draft-pagination-btn:hover:not(:disabled) {
  background: var(--surface);
}

.crm-draft-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.crm-draft-pagination-num {
  min-width: 36px;
  padding: 6px 8px;
}

.crm-aziende-block .crm-draft-pagination .crm-draft-pagination-num,
.crm-table-block .crm-draft-pagination .crm-draft-pagination-num {
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
}

.crm-draft-pagination-num-active {
  background: var(--accent);
  border-color: var(--primary);
  font-weight: 600;
  cursor: default;
}

.crm-aziende-block .crm-draft-pagination .crm-draft-pagination-num-active,
.crm-table-block .crm-draft-pagination .crm-draft-pagination-num-active {
  background: #000000;
  border: none;
  color: #ffffff;
}

.crm-aziende-block .crm-draft-pagination .crm-draft-pagination-num-active:hover,
.crm-table-block .crm-draft-pagination .crm-draft-pagination-num-active:hover {
  background: #000000;
  opacity: 1;
}

.crm-draft-pagination-num-active:hover {
  background: var(--accent);
}

.crm-draft-pagination-arrow {
  padding: 6px 10px;
}

.crm-aziende-block .crm-draft-pagination .crm-draft-pagination-arrow img,
.crm-table-block .crm-draft-pagination .crm-draft-pagination-arrow img {
  display: block;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.crm-draft-card-action {
  margin-top: 10px;
  font-size: 20px;
  color: var(--muted-foreground);
}

.crm-draft-card-action a {
  color: var(--foreground);
  text-decoration: none;
}

.crm-draft-card-action a:hover {
  text-decoration: underline;
}

.crm-draft-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.crm-draft-section {
  margin-bottom: 28px;
}

.crm-draft-section:last-child {
  margin-bottom: 0;
}

.crm-draft-section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--muted-foreground);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.crm-draft-btn-add {
  padding: 8px;
}
.crm-draft-btn-add img {
  display: block;
  width: 20px;
  height: 20px;
}

/* Modal anagrafica: blur + max-width + form flex */
.anagrafica-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}
.anagrafica-modal-overlay-nascondi {
  display: none;
}
.anagrafica-modal-overlay:not(.anagrafica-modal-overlay-nascondi) {
  pointer-events: auto;
}
.anagrafica-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 0;
}
.anagrafica-modal-box {
  position: relative;
  z-index: 1;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.anagrafica-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.anagrafica-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}
.anagrafica-modal-close {
  padding: 8px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--muted-foreground);
}
.anagrafica-modal-close:hover {
  background-color: var(--surface);
  color: var(--foreground);
}
.anagrafica-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.anagrafica-modal-form .crm-draft-form {
  max-width: none;
}
.anagrafica-modal-form .crm-draft-section {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 20px;
}
.anagrafica-modal-form .crm-draft-section:last-child {
  margin-bottom: 0;
}
.anagrafica-modal-form .crm-draft-field {
  flex: 1 1 200px;
  min-width: 0;
}
.anagrafica-modal-form .crm-draft-field-check {
  flex: 1 1 100%;
}
.anagrafica-modal-form .crm-draft-field label[for] + textarea,
.anagrafica-modal-form .crm-draft-field:has(textarea) {
  flex: 1 1 100%;
}

.assistente-search-wrap {
  width: 70%;
  max-width: 700px;
}

.assistente-search-box {
  background-color: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.assistente-search-textarea {
  width: 100%;
  min-height: 44px;
  padding: 0;
  margin-bottom: 12px;
  border: none;
  outline: none;
  resize: none;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  line-height: 1.5;
  color: var(--foreground);
  background: transparent;
}

.assistente-search-textarea:focus,
.assistente-search-textarea:focus-visible {
  outline: none;
  border: none;
  box-shadow: none;
}

.assistente-search-textarea::placeholder {
  color: #9ca3af;
}

.assistente-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.assistente-search-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.assistente-search-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assistente-dropdown-wrap {
  position: relative;
  width: fit-content;
}

.assistente-dropdown-trigger {
  width: fit-content;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid #374151;
  font-family: "Figtree", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  background-color: var(--card);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.assistente-dropdown-trigger:hover {
  background-color: var(--surface);
}

.assistente-dropdown-trigger-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.assistente-dropdown-trigger-label {
  white-space: nowrap;
}

.assistente-dropdown-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: transform 0.2s;
}

.assistente-dropdown-wrap.assistente-dropdown-open .assistente-dropdown-chevron {
  transform: rotate(180deg);
}

.assistente-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 100%;
  background-color: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 40;
  padding: 4px;
  display: none;
}

.assistente-dropdown-wrap.assistente-dropdown-open .assistente-dropdown-panel {
  display: block;
}

.assistente-dropdown-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  border: none;
  border-radius: var(--radius);
  background: none;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
  position: relative;
}

.assistente-dropdown-option:hover {
  background-color: #f3f4f6;
}

.assistente-dropdown-option[aria-selected="true"] {
  background-color: #f3f4f6;
}

.assistente-dropdown-option-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.assistente-dropdown-option-check {
  width: 14px;
  height: 14px;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.7;
}

.assistente-dropdown-option[aria-selected="false"] .assistente-dropdown-option-check {
  display: none;
}

.assistente-search-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.assistente-search-allega {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid #374151;
  font-family: "Figtree", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  background-color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.assistente-search-allega:hover {
  background-color: var(--surface);
}

.assistente-search-action-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius);
  border: none;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  background-color: #000000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.assistente-search-action-btn:hover {
  background-color: var(--foreground);
}

.assistente-search-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.assistente-search-action-btn .assistente-search-icon {
  filter: brightness(0) invert(1);
}

.assistente-search-file-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.assistente-cronologia-bar {
  flex-shrink: 0;
  padding: 24px 32px;
  border-top: 1px solid var(--accent);
  background-color: var(--card);
  display: flex;
  justify-content: center;
}

.assistente-cronologia-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: #4b5563;
  cursor: pointer;
}

.assistente-cronologia-btn:hover {
  color: var(--foreground);
}

.assistente-cronologia-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.assistente-cronologia-chevron-open {
  transform: rotate(180deg);
}

.assistente-cronologia-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s;
  background-color: var(--surface);
  border-top: 1px solid var(--accent);
}

.assistente-cronologia-panel-open {
  max-height: 480px;
  overflow-y: auto;
}

.assistente-cronologia-panel-inner {
  padding: 16px 32px 24px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.assistente-cronologia-vuoto {
  font-size: 20px;
  color: var(--muted-foreground);
}

.risultati-query-wrap {
  padding: 24px;
}

.risultati-query-label {
  font-size: 20px;
  color: var(--muted-foreground);
  margin-bottom: 8px;
}

.risultati-query-text {
  font-size: 20px;
  color: var(--foreground);
  margin-bottom: 16px;
}

.risultati-vuoto-cta {
  margin-bottom: 16px;
}

.risultati-ordina-wrap {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.risultati-ordina-label {
  font-size: 20px;
  color: var(--muted-foreground);
}

.risultati-ordina-select {
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  padding: 6px 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background-color: var(--card);
  color: var(--foreground);
}

.risultati-back-link {
  font-size: 20px;
  color: #4b5563;
  cursor: pointer;
  background: none;
  border: none;
  font-family: "Figtree", sans-serif;
  padding: 0;
}

.risultati-back-link:hover {
  color: var(--foreground);
  text-decoration: underline;
}

a.risultati-back-link {
  text-decoration: none;
}

.risultati-sep {
  color: #9ca3af;
  margin: 0 4px;
}

.risultati-list-wrap {
  margin-top: 24px;
}

.risultati-count {
  font-size: 20px;
  color: var(--muted-foreground);
  margin-bottom: 16px;
}

.risultati-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.risultati-export-csv {
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.risultati-export-csv:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.risultati-paginazione-in-table {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--card);
}

.crm-table-block .risultati-classica-table td {
  color: #374151;
}

.risultati-table-wrap {
  background-color: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
}

.risultati-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 20px;
}

.risultati-th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: #000;
  border-bottom: 2px solid var(--accent);
  white-space: nowrap;
}

.risultati-tr {
  cursor: pointer;
  border-bottom: 1px solid var(--accent);
  transition: background-color 0.15s;
}

.risultati-tr:hover {
  background-color: var(--surface);
}

.risultati-td {
  padding: 12px 14px;
  color: #000;
  vertical-align: top;
}

.risultati-td-num {
  white-space: nowrap;
  color: #000;
  width: 80px;
}

.risultati-td-titolo {
  font-weight: 500;
}

.risultati-td-data {
  white-space: nowrap;
  color: #000;
}

.risultati-td-estratto {
  color: #000;
  line-height: 1.5;
}

.risultati-card {
  background-color: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.risultati-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.risultati-card-titolo {
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 4px;
}

.risultati-card-meta {
  font-size: 20px;
  color: var(--muted-foreground);
  margin-bottom: 8px;
}

.risultati-card-contenuto {
  font-size: 20px;
  color: var(--foreground);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.risultati-load-more {
  margin-top: 20px;
  padding: 10px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background-color: var(--card);
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  cursor: pointer;
}

.risultati-load-more:hover {
  background-color: var(--surface);
}

.risultati-paginazione {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--accent);
}

.risultati-pag-btn {
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background-color: var(--card);
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.risultati-pag-btn:hover:not(:disabled) {
  background-color: var(--surface);
}

.risultati-pag-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.risultati-pag-info {
  font-size: 20px;
  color: var(--muted-foreground);
}

.risultati-loading {
  margin-top: 24px;
  color: var(--muted-foreground);
}

.chat-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.chat-header {
  flex-shrink: 0;
  padding: 16px 24px;
  border-bottom: 1px solid var(--accent);
  background-color: var(--card);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-back-btn {
  padding: 0;
  border: none;
  background: none;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-back-btn:hover {
  color: var(--foreground);
}

.chat-back-icon {
  width: 20px;
  height: 20px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-msg-wrap {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.chat-msg-wrap-user {
  justify-content: center;
}

.chat-msg-wrap-ai {
  justify-content: center;
}

.chat-msg-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 70%;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  align-items: start;
}

.chat-msg-ai-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-msg-box-descrizione {
  padding: 12px 16px;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 34px;
}

.chat-msg-box-descrizione .chat-msg-descrizione {
  margin: 0;
  font-size: 20px;
  line-height: 1.5;
  color: var(--foreground);
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg-wrap-ai .chat-msg-avatar {
  grid-column: 1;
  justify-self: end;
}

.chat-msg-wrap-user .chat-msg-avatar {
  grid-column: 3;
  justify-self: start;
}

.chat-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--foreground);
}

.chat-msg-avatar-user {
  background-color: #f3f4f6;
  border: 2px solid var(--accent);
}

.chat-msg-avatar-ai {
  background-color: var(--card);
  border: 2px solid var(--primary);
}

.chat-msg-bubble {
  min-width: 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 20px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg-bubble-user {
  background-color: var(--foreground);
  color: #ffffff;
}

.chat-msg-bubble-ai {
  background-color: var(--ai-bubble-bg);
  color: var(--foreground);
  border: 1px solid var(--ai-bubble-border);
  border-radius: 34px;
}

.chat-msg-descrizione {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg-articoli {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-msg-articolo {
  padding: 1rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 34px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.chat-msg-articolo:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  border-color: #d1d5db;
}

.chat-msg-articolo-inner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.chat-msg-articolo-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  background-color: #dbeafe;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-msg-articolo-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.chat-msg-articolo-body {
  flex: 1;
  min-width: 0;
}

.chat-msg-articolo-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 6px;
}

.chat-msg-articolo-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 20px;
  font-weight: 500;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  color: var(--muted-foreground);
}

.chat-msg-articolo-tag-num {
  color: var(--foreground);
}

.chat-msg-articolo-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.chat-msg-articolo:hover .chat-msg-articolo-title {
  color: #2563eb;
}

.chat-msg-articolo-content {
  font-size: 20px;
  line-height: 1.5;
  color: var(--muted-foreground);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}

.chat-msg-articolo-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.chat-msg-articolo-link-icon {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

.chat-msg-articolo:hover .chat-msg-articolo-link-icon {
  opacity: 1;
}

.chat-typing-wrap {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.chat-typing-wrap .chat-msg-inner {
  width: 70%;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.chat-typing-loader-container .ai-loader {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  font-family: "Figtree", sans-serif;
  font-size: 14px;
  user-select: none;
}

.chat-typing-loader-container .ai-loader__logo {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-typing-loader-container .ai-loader__logo svg {
  overflow: visible;
}

.chat-typing-loader-container .logo-body {
  fill: #000000;
}

.chat-typing-loader-container .logo-dot-mid,
.chat-typing-loader-container .logo-dot-top {
  fill: #000000;
}

.chat-typing-loader-container .logo-dot-mid {
  transform-origin: 3.5px 1.5px;
}

.chat-typing-loader-container .logo-dot-top {
  transform-origin: 4.5px 0.5px;
}

.chat-typing-loader-container .logo-dot-mid.animating {
  animation: chat-loader-dot-mid 1.56s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.chat-typing-loader-container .logo-dot-top.animating {
  animation: chat-loader-dot-top 1.56s cubic-bezier(0.4, 0, 0.2, 1) infinite 0.2s;
}

@keyframes chat-loader-dot-mid {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  15%  { transform: translate(2px, -2px) scale(1.15); opacity: 0.85; }
  35%  { transform: translate(4px, -4px) scale(0.8); opacity: 0.45; }
  50%  { transform: translate(3px, -5px) scale(0.7); opacity: 0.35; }
  70%  { transform: translate(1px, -2px) scale(0.9); opacity: 0.7; }
  90%  { transform: translate(0.2px, -0.3px) scale(1.05); opacity: 0.95; }
  100% { transform: translate(0, 0) scale(1); opacity: 1; }
}

@keyframes chat-loader-dot-top {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  12%  { transform: translate(1px, -1.5px) scale(1.2); opacity: 0.8; }
  30%  { transform: translate(3px, -5px) scale(0.75); opacity: 0.4; }
  50%  { transform: translate(5px, -3px) scale(0.6); opacity: 0.3; }
  65%  { transform: translate(3px, -1px) scale(0.85); opacity: 0.6; }
  85%  { transform: translate(0.5px, -0.2px) scale(1.08); opacity: 0.9; }
  100% { transform: translate(0, 0) scale(1); opacity: 1; }
}

.chat-typing-loader-container .ai-loader__typing {
  display: inline-flex;
  align-items: center;
  color: #1a1a1a;
  font-weight: 400;
  letter-spacing: 0.01em;
  min-height: 1.4em;
}

.chat-typing-loader-container .ai-loader__typing-text {
  overflow: hidden;
  white-space: nowrap;
}

.chat-typing-loader-container .ai-loader__cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: #000000;
  border-radius: 1px;
  animation: chat-loader-blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
  flex-shrink: 0;
}

@keyframes chat-loader-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.chat-main > .assistente-search-wrap {
  flex-shrink: 0;
  padding: 24px;
  margin-left: auto;
  margin-right: auto;
}

.articolo-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.articolo-modal-overlay-nascondi {
  display: none;
}

.articolo-modal-box {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-width: 896px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.articolo-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--accent);
}

.articolo-modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.articolo-modal-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background-color: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
}

.articolo-modal-icon {
  width: 20px;
  height: 20px;
}

.articolo-modal-titolo {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
}

.articolo-modal-close {
  padding: 8px;
  border: none;
  background: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.articolo-modal-close:hover {
  background-color: #f3f4f6;
}

.articolo-modal-close-icon {
  width: 20px;
  height: 20px;
}

.articolo-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.articolo-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 20px;
  color: #4b5563;
  margin-bottom: 24px;
}

.articolo-modal-contenuto-wrap {
  background-color: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
}

.articolo-modal-contenuto-titolo {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 16px;
}

.articolo-modal-contenuto-testo {
  font-size: 20px;
  color: var(--foreground);
  line-height: 1.6;
  white-space: pre-wrap;
}

.articolo-modal-copia {
  margin-top: 16px;
  padding: 8px 16px;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background-color: var(--card);
  color: var(--foreground);
  cursor: pointer;
}

.articolo-modal-copia:hover {
  background-color: #f3f4f6;
}

.dettaglio-doc-wrap {
  max-width: 896px;
  padding: 24px 0;
}

.dettaglio-doc-back {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 16px;
  color: var(--accent);
  text-decoration: none;
}

.dettaglio-doc-back:hover {
  text-decoration: underline;
}

.dettaglio-doc-loading {
  font-size: 18px;
  color: var(--foreground);
}

.dettaglio-doc-wrap .dettaglio-doc-box.articolo-modal-box {
  max-height: none;
}

.assistente-cronologia-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .assistente-cronologia-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 641px) and (max-width: 880px) {
  .assistente-cronologia-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.assistente-cronologia-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  box-sizing: border-box;
  background-color: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.assistente-cronologia-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.assistente-cronologia-card-query {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  max-height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 20px;
  font-weight: 400;
  color: var(--muted-foreground);
}

.assistente-cronologia-loading,
.assistente-cronologia-empty {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 16px 20px;
  background-color: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 20px;
  color: var(--muted-foreground);
}

.assistente-cronologia-lista {
  list-style: none;
  padding: 0;
  margin: 0;
}

.assistente-cronologia-item {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--accent);
  font-size: 20px;
  color: var(--foreground);
  cursor: pointer;
  text-decoration: none;
}

.assistente-cronologia-item:hover {
  color: #4b5563;
}

.assistente-cronologia-item:last-child {
  border-bottom: none;
}

.assistente-cronologia-item-query {
  display: block;
  color: var(--muted-foreground);
  margin-top: 4px;
  font-weight: 400;
}

.sentenze-wrap {
  padding: 32px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.sentenze-titolo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.sentenze-titolo-icon {
  width: 28px;
  height: 28px;
}

.sentenze-titolo-testo {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
}

.sentenze-form-box {
  background-color: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.sentenze-grid {
  display: contents;
}

.sentenze-campo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 300px;
  min-width: 100px;
  max-width: 100%;
}

.sentenze-label {
  font-size: 20px;
  font-weight: 500;
  color: var(--foreground);
}

.sentenze-input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: var(--foreground);
  min-width: 100px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.sentenze-form-panel {
  display: contents;
}

.sentenze-form-panel-nascondi {
  display: none;
}

.sentenze-campo-full {
  flex: 1 1 300px;
  min-width: 100px;
  max-width: 100%;
}

.sentenze-dropdown-wrap {
  position: relative;
  min-width: 100px;
  max-width: 100%;
}

.sentenze-dropdown-trigger {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  background-color: var(--card);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  box-sizing: border-box;
}

.sentenze-dropdown-trigger:hover {
  background-color: var(--surface);
}

.sentenze-dropdown-trigger-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.sentenze-dropdown-trigger-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sentenze-dropdown-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: transform 0.2s;
}

.sentenze-dropdown-wrap.sentenze-dropdown-open .sentenze-dropdown-chevron {
  transform: rotate(180deg);
}

.sentenze-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 100%;
  background-color: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 40;
  padding: 4px;
  display: none;
}

.sentenze-dropdown-wrap.sentenze-dropdown-open .sentenze-dropdown-panel {
  display: block;
}

.sentenze-dropdown-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  border: none;
  border-radius: var(--radius);
  background: none;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
  position: relative;
}

.sentenze-dropdown-option:hover {
  background-color: #f3f4f6;
}

.sentenze-dropdown-option[aria-selected="true"] {
  background-color: #f3f4f6;
}

.sentenze-dropdown-option-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.sentenze-dropdown-option-check {
  width: 14px;
  height: 14px;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.7;
}

.sentenze-dropdown-option[aria-selected="false"] .sentenze-dropdown-option-check {
  display: none;
}

.sentenze-campo-tipo {
  flex: 1 1 300px;
  min-width: 100px;
  max-width: 100%;
}

.sentenze-select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: var(--foreground);
  background-color: var(--card);
  cursor: pointer;
  min-width: 100px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.sentenze-bottone {
  height: 40px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius);
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: #ffffff;
  background-color: var(--foreground);
  cursor: pointer;
  flex: 1 1 100%;
  min-width: 0;
  margin-top: 4px;
}

.sentenze-bottone:hover {
  background-color: var(--foreground);
}

.sentenze-risultati-wrap {
  margin-top: 1.5rem;
}

.sentenze-risultati-placeholder,
.sentenze-risultati {
  font-size: 20px;
  color: var(--muted-foreground);
}

.sentenze-risultati-block {
  margin-top: 0.5rem;
}

.sentenze-risultati-block .risultati-count {
  margin-bottom: 0.5rem;
}

.libreria-nascondi {
  display: none;
}

.libreria-wrap {
  padding: 32px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.libreria-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.libreria-titolo-icon {
  width: 28px;
  height: 28px;
}

.libreria-titolo {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.libreria-help {
  padding: 4px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted-foreground);
}

.libreria-help:hover {
  color: var(--foreground);
}

.libreria-help-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.libreria-upload-card {
  background-color: var(--card);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.libreria-upload-card:hover {
  border-color: #9ca3af;
  background-color: var(--surface);
}

.libreria-upload-card.libreria-upload-dragover {
  border-color: #3b82f6;
  background-color: #eff6ff;
}

.libreria-upload-placeholder {
  text-align: center;
}

.libreria-upload-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: block;
  color: #9ca3af;
}

.libreria-upload-card:hover .libreria-upload-icon {
  color: #3b82f6;
}

.libreria-upload-titolo {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0 0 8px;
}

.libreria-upload-testo {
  font-size: 20px;
  color: var(--muted-foreground);
  margin: 0 0 8px;
}

.libreria-upload-formati {
  font-size: 20px;
  color: #9ca3af;
  margin: 0;
}

.libreria-upload-progress .libreria-upload-titolo {
  margin-bottom: 16px;
}

.libreria-upload-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 20px;
}

.libreria-upload-filename {
  font-weight: 500;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
}

.libreria-upload-percent {
  font-weight: 600;
  color: var(--foreground);
  flex-shrink: 0;
}

.libreria-upload-bar {
  height: 8px;
  background-color: var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
}

.libreria-upload-bar-fill {
  height: 100%;
  background-color: #3b82f6;
  width: 0%;
  transition: width 0.2s;
}

.libreria-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.libreria-search-wrap {
  flex: 1;
  min-width: 200px;
  max-width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.libreria-search-icon {
  position: absolute;
  left: 12px;
  width: 20px;
  height: 20px;
  pointer-events: none;
  color: var(--muted-foreground);
}

.libreria-toolbar .libreria-input {
  width: 100%;
  padding-left: 40px;
  box-sizing: border-box;
}

.libreria-input {
  height: 40px;
  padding: 0 12px;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: var(--foreground);
  background-color: var(--card);
}

.libreria-input:focus {
  outline: none;
}

.libreria-select {
  height: 40px;
  padding: 0 12px;
  min-width: 200px;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  background-color: var(--card);
  cursor: pointer;
}

.libreria-file-input-nascondi {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.libreria-sezione {
  margin-bottom: 32px;
}

.libreria-sezione-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.libreria-sezione-icon {
  width: 24px;
  height: 24px;
}

.libreria-sezione-titolo {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.libreria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.libreria-card {
  background-color: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  transition: box-shadow 0.2s;
}

.libreria-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.libreria-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.libreria-card-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #5d5bd0;
}

.libreria-card-badge {
  font-size: 20px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius);
}

.libreria-card-badge-completato {
  background-color: #dcfce7;
  color: #166534;
}

.libreria-card-badge-lavorazione {
  background-color: #fef9c3;
  color: #854d0e;
}

.libreria-card-titolo {
  font-size: 20px;
  font-weight: 500;
  color: var(--foreground);
  margin: 0 0 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.libreria-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 20px;
  color: var(--muted-foreground);
  margin-bottom: 12px;
}

.libreria-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.libreria-card-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: none;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: var(--muted-foreground);
  cursor: pointer;
}

.libreria-card-action:hover {
  color: var(--foreground);
}

.libreria-card-action-icon {
  width: 14px;
  height: 14px;
}

.libreria-expand-wrap {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.libreria-expand-btn {
  padding: 8px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted-foreground);
  border-radius: var(--radius);
}

.libreria-expand-btn:hover {
  background-color: #f3f4f6;
  color: var(--foreground);
}

.libreria-expand-chevron {
  width: 24px;
  height: 24px;
  display: block;
  transition: transform 0.2s;
}

.libreria-expand-wrap.libreria-expand-open .libreria-expand-chevron {
  transform: rotate(180deg);
}

.libreria-apri-modal-overlay,
.libreria-delete-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.libreria-modal-nascondi {
  display: none;
}

.libreria-apri-modal-box,
.libreria-delete-modal-box {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-width: 448px;
  width: 100%;
  overflow: hidden;
}

.libreria-apri-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--accent);
}

.libreria-apri-modal-titolo,
.libreria-delete-modal-titolo {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.libreria-apri-modal-body {
  padding: 24px;
}

.libreria-apri-modal-testo,
.libreria-delete-modal-desc {
  font-size: 20px;
  color: var(--muted-foreground);
  margin: 0 0 16px;
}

.libreria-apri-option {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  margin-bottom: 8px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: "Figtree", sans-serif;
  transition: background-color 0.2s;
}

.libreria-apri-option:last-child {
  margin-bottom: 0;
}

.libreria-apri-option:hover {
  background-color: var(--surface);
}

.libreria-apri-option-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: #5d5bd0;
}

.libreria-apri-option-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.libreria-apri-option-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--foreground);
}

.libreria-apri-option-desc {
  font-size: 20px;
  color: var(--muted-foreground);
}

.libreria-delete-modal-box {
  padding: 24px;
}

.libreria-delete-modal-desc {
  margin-bottom: 24px;
}

.libreria-delete-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.libreria-delete-cancel {
  padding: 8px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  font-weight: 500;
  background-color: var(--card);
  color: var(--foreground);
  cursor: pointer;
}

.libreria-delete-cancel:hover {
  background-color: var(--surface);
}

.libreria-delete-confirm {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  font-weight: 500;
  background-color: #800e13;
  color: #ffffff;
  cursor: pointer;
}

.libreria-delete-confirm:hover {
  background-color: #600a0e;
}

.libreria-doc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.libreria-doc-modal-overlay-nascondi {
  display: none;
}

.libreria-doc-modal-box {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-width: 896px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.libreria-doc-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--accent);
}

.libreria-doc-modal-titolo {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
}

.libreria-doc-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.libreria-doc-modal-testo {
  font-size: 20px;
  color: var(--foreground);
  line-height: 1.6;
  white-space: pre-wrap;
  background-color: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
}

.sidebar-account-row {
  position: relative;
}

.sidebar-account-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius);
  background: none;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: #4b5563;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s, color 0.15s;
  box-sizing: border-box;
}

.sidebar-account-toggle:hover {
  background-color: #f3f4f6;
  color: var(--foreground);
}

.account-menu-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  width: 320px;
  background-color: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 60;
  padding: 8px;
}

.account-menu-dropdown-nascondi {
  display: none;
}

.account-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius);
  background: none;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: var(--foreground);
  cursor: pointer;
  text-align: left;
}

.account-menu-item:hover {
  background-color: #f3f4f6;
  color: var(--foreground);
}

.account-menu-sep {
  height: 1px;
  background-color: var(--accent);
  margin: 8px 0;
}

.impostazioni-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}

.impostazioni-modal-overlay-nascondi {
  display: none;
}

.impostazioni-modal-overlay:not(.impostazioni-modal-overlay-nascondi) {
  pointer-events: auto;
}

.impostazioni-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 0;
}

.impostazioni-modal-box {
  position: relative;
  z-index: 1;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 56rem;
  max-height: 80vh;
  display: flex;
  overflow: hidden;
}

.impostazioni-page-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  background-color: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.impostazioni-page-back {
  display: inline-block;
  padding: 8px 0;
  font-size: 16px;
  color: var(--muted-foreground);
  text-decoration: none;
}

.impostazioni-page-back:hover {
  color: var(--foreground);
}

.impostazioni-modal-sidebar {
  width: 16rem;
  flex-shrink: 0;
  background-color: var(--surface);
  border-right: 1px solid var(--accent);
  display: flex;
  flex-direction: column;
}

.impostazioni-modal-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--accent);
}

.impostazioni-modal-close {
  padding: 8px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--muted-foreground);
}

.impostazioni-modal-close:hover {
  background-color: #f3f4f6;
  color: var(--foreground);
}

.impostazioni-modal-nav {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.impostazioni-modal-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius);
  background: none;
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: var(--muted-foreground);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.impostazioni-modal-nav-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--foreground);
}

.impostazioni-modal-nav-item-active {
  background-color: var(--card);
  color: var(--foreground);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.impostazioni-modal-nav-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.impostazioni-modal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.impostazioni-modal-content-header {
  flex-shrink: 0;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--accent);
}

.impostazioni-modal-titolo {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
  text-transform: capitalize;
}

.impostazioni-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.impostazioni-modal-section {
  display: block;
}

.impostazioni-section-nascondi {
  display: none !important;
}

.impostazioni-modal-testo {
  font-size: 20px;
  color: var(--muted-foreground);
  margin: 0 0 16px;
}

/* Form */
.impostazioni-form-group {
  margin-bottom: 20px;
}

.impostazioni-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.impostazioni-field .impostazioni-label {
  margin-bottom: 8px;
}

.impostazioni-label {
  display: block;
  font-size: 20px;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 8px;
}

.impostazioni-label-title {
  display: block;
  font-weight: 500;
  color: var(--foreground);
}

.impostazioni-label-desc {
  display: block;
  font-size: 20px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.impostazioni-input {
  width: 100%;
  max-width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  color: var(--foreground);
  background-color: var(--card);
  box-sizing: border-box;
}

.impostazioni-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Switch (toggle) */
.impostazioni-row-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.impostazioni-switch-label {
  flex: 1;
  min-width: 0;
}

.impostazioni-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.impostazioni-switch-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.impostazioni-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #d1d5db;
  border-radius: 34px;
  transition: background 0.2s;
}

.impostazioni-switch-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.impostazioni-switch-input:checked + .impostazioni-switch-slider {
  background-color: var(--primary);
}

.impostazioni-switch-input:checked + .impostazioni-switch-slider::before {
  transform: translateX(20px);
}

/* Buttons */
.impostazioni-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: "Figtree", sans-serif;
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.impostazioni-btn-icon {
  flex-shrink: 0;
}

.impostazioni-btn-primary {
  background-color: var(--primary);
  color: #fff;
}

.impostazioni-btn-primary:hover {
  filter: brightness(1.05);
}

.impostazioni-btn-outline {
  background: none;
  border-color: var(--accent);
  color: var(--foreground);
}

.impostazioni-btn-outline:hover {
  background-color: var(--surface);
}

.impostazioni-btn-sm {
  padding: 6px 14px;
  font-size: 20px;
}

.impostazioni-btn-danger {
  background: none;
  border-color: #dc2626;
  color: #dc2626;
}

.impostazioni-btn-danger:hover {
  background-color: rgba(220, 38, 38, 0.08);
}

.impostazioni-btn-block {
  width: 100%;
}

.impostazioni-btn + .impostazioni-btn {
  margin-left: 8px;
}

/* Generale: avatar */
.impostazioni-row-photo {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--accent);
}

.impostazioni-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.impostazioni-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.impostazioni-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.impostazioni-avatar-img-nascondi {
  display: none;
}

.impostazioni-avatar-placeholder {
  font-size: 20px;
  color: var(--muted-foreground);
}

.impostazioni-avatar-placeholder.impostazioni-avatar-img-nascondi {
  display: none;
}

.impostazioni-avatar-btn {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background-color: var(--foreground);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.impostazioni-avatar-btn:hover {
  filter: brightness(0.9);
}

.impostazioni-avatar-input {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Sicurezza */
.impostazioni-error {
  font-size: 20px;
  color: #dc2626;
  margin: 0 0 12px;
}

.impostazioni-error-nascondi {
  display: none;
}

/* Account row actions */
.impostazioni-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--accent);
}

.impostazioni-label-danger {
  color: #dc2626 !important;
}

/* Integrazioni */
.impostazioni-integrazione-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.impostazioni-integrazione-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.impostazioni-integrazione-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.impostazioni-integrazione-nome {
  font-size: 20px;
  font-weight: 500;
  color: var(--foreground);
  margin: 0 0 2px;
}

.impostazioni-integrazione-desc {
  font-size: 20px;
  color: var(--muted-foreground);
  margin: 0;
}

.impostazioni-integrazione-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.impostazioni-integrazione-status {
  font-size: 20px;
}

.impostazioni-integrazione-status-ok {
  color: #059669;
}

.impostazioni-integrazioni-add-wrap {
  padding-top: 16px;
  border-top: 1px solid var(--accent);
  margin-top: 16px;
}

.extra-pagina-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.extra-pagina-titolo {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #ffffff;
}

.extra-pagina-sottotitolo {
  font-size: 20px;
  color: #697484;
  margin-bottom: 32px;
}

.extra-pagina-sezione {
  margin-bottom: 28px;
}

.extra-pagina-sezione-titolo {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 12px;
}

.extra-pagina-paragrafo {
  font-size: 20px;
  line-height: 1.6;
  color: var(--muted-foreground);
  margin-bottom: 12px;
}

.extra-pagina-lista {
  margin: 12px 0 12px 20px;
  padding: 0;
  color: var(--muted-foreground);
  font-size: 20px;
  line-height: 1.6;
}

.extra-pagina-link-wrap {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.extra-pagina-link-sep {
  color: #697484;
  font-size: 20px;
}

.extra-pagina-link {
  color: #ffffff;
  text-decoration: underline;
}

.extra-pagina-link:hover {
  color: var(--accent);
}

.extra-404-numero {
  font-size: 20px;
  font-weight: 700;
  color: #4b5563;
  margin-bottom: 16px;
  line-height: 1;
}
