/* =============================================================================
   TASK CRM — Design System
   Font: Roboto (Google Fonts)
   Icons: Font Awesome 6
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap');

/* =============================================================================
   1. VARIABILI
   ============================================================================= */
:root {
  /* Palette primaria */
  --primary:        #1565C0;
  --primary-light:  #1976D2;
  --primary-lighter:#2196F3;
  --primary-dark:   #0D47A1;
  --primary-hover:  #1251a3;

  /* Header gradient */
  --header-from:    #1a5fa0;
  --header-to:      #2980b9;

  /* Semantici */
  --success:        #27AE60;
  --success-light:  #2ECC71;
  --success-bg:     #E8F5E9;
  --warning:        #E67E22;
  --warning-light:  #F39C12;
  --warning-bg:     #FFF3E0;
  --danger:         #E74C3C;
  --danger-light:   #FF6B6B;
  --danger-bg:      #FFEBEE;
  --info:           #2980B9;
  --info-bg:        #E3F2FD;

  /* Sfondo e superfici */
  --bg:             #F0F2F5;
  --card-bg:        #FFFFFF;
  --card-bg-hover:  #FAFBFC;
  --sidebar-bg:     #FFFFFF;
  --border:         #E8EAED;
  --border-light:   #F1F3F4;

  /* Testo */
  --text:           #2C3E50;
  --text-muted:     #7F8C8D;
  --text-light:     #95A5A6;
  --text-white:     #FFFFFF;

  /* Icone stat card */
  --icon-blue:      #1565C0;
  --icon-teal:      #00897B;
  --icon-orange:    #E67E22;
  --icon-green:     #27AE60;
  --icon-red:       #E74C3C;
  --icon-purple:    #8E44AD;
  --icon-cyan:      #00ACC1;
  --icon-amber:     #F39C12;
  --icon-gray:      #7F8C8D;
  --icon-indigo:    #3949AB;
  --icon-pink:      #C2185B;
  --icon-lime:      #558B2F;

  /* Struttura */
  --header-height:  60px;
  --navbar-height:  50px;
  --content-pad:    24px;

  /* Effetti */
  --shadow-card:    0 2px 8px rgba(0, 0, 0, 0.07);
  --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-dropdown:0 8px 24px rgba(0, 0, 0, 0.13);
  --shadow-header:  0 2px 12px rgba(0, 0, 0, 0.18);

  /* Bordi arrotondati */
  --radius-sm:      4px;
  --radius:         8px;
  --radius-lg:      12px;
  --radius-xl:      16px;

  /* Transizioni */
  --transition:     0.18s ease;
  --transition-slow:0.3s ease;
}

/* =============================================================================
   2. RESET & BASE
   ============================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

ul, ol { list-style: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* =============================================================================
   3. LAYOUT PRINCIPALE
   ============================================================================= */
.task-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.task-body {
  padding-top: calc(var(--header-height) + var(--navbar-height));
  flex: 1;
}

.task-content {
  padding: var(--content-pad);
  margin: 0 auto;
  width: 100%;
}

/* =============================================================================
   4. HEADER — Barra blu superiore
   ============================================================================= */
.task-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: linear-gradient(135deg, var(--header-from) 0%, var(--header-to) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: var(--shadow-header);
}

/* Logo */
.task-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-white);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  text-decoration: none;
  user-select: none;
}

.task-header__logo-name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.task-header__logo-sub {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
  background: rgba(255,255,255,0.18);
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* Azioni header destra */
.task-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-header__icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text-white);
  font-size: 1rem;
}

.task-header__icon-btn:hover {
  background: rgba(255,255,255,0.15);
}

.task-header__icon-btn--red    { background: #E53935; }
.task-header__icon-btn--teal   { background: #00897B; }
.task-header__icon-btn--yellow { background: #F9A825; }
.task-header__icon-btn--gray   { background: rgba(255,255,255,0.2); }

.task-header__icon-btn--red:hover    { background: #C62828; }
.task-header__icon-btn--teal:hover   { background: #00695C; }
.task-header__icon-btn--yellow:hover { background: #F57F17; }
.task-header__icon-btn--gray:hover   { background: rgba(255,255,255,0.2); }

/* Badge notifiche */
.task-header__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  background: #FFD600;
  color: #333;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255,255,255,0.6);
}

/* =============================================================================
   5. NAVBAR — Barra di navigazione secondaria
   ============================================================================= */
.task-navbar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  z-index: 999;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  overflow-x: auto;
  scrollbar-width: none;
}
.task-navbar::-webkit-scrollbar { display: none; }

/* Item navbar */
.task-nav-item {
  position: relative;
  flex-shrink: 0;
}

.task-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: var(--navbar-height);
  color: #555;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition);
  user-select: none;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.task-nav-link:hover {
  color: var(--primary);
  border-bottom-color: var(--border-light);
}

.task-nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.task-nav-link i.fa-icon-nav {
  font-size: 0.9rem;
  opacity: 0.8;
}

.task-nav-link .fa-chevron-down {
  font-size: 0.65rem;
  margin-left: 2px;
  opacity: 0.6;
  transition: transform var(--transition);
}

.task-nav-item.open .fa-chevron-down {
  transform: rotate(180deg);
}

/* Dropdown navbar */
.task-dropdown {
  position: absolute;
  top: calc(100% + 0px);
  left: 0;
  min-width: 200px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 1100;
}

.task-nav-item.open .task-dropdown,
.task-nav-item:focus-within .task-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.task-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.task-dropdown__item:hover {
  background: var(--info-bg);
  color: var(--primary);
}

.task-dropdown__item i {
  width: 16px;
  text-align: center;
  color: var(--primary);
  opacity: 0.7;
  font-size: 0.8rem;
}

.task-dropdown__divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

/* =============================================================================
   6. SEZIONI DASHBOARD
   ============================================================================= */
.dash-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.dash-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.dash-section__header:hover {
  background: #FAFBFC;
}

.dash-section__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-section__title i {
  color: var(--primary);
  font-size: 0.85rem;
}

.dash-section__toggle {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.dash-section.collapsed .dash-section__toggle {
  transform: rotate(180deg);
}

.dash-section__body {
  padding: 20px;
  transition: max-height var(--transition-slow), opacity var(--transition-slow);
  max-height: 2000px;
  opacity: 1;
  overflow: hidden;
}

.dash-section.collapsed .dash-section__body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Sezione senza padding (per tabelle full-width) */
.dash-section__body--flush {
  padding: 0;
}

/* =============================================================================
   7. STAT CARDS — Cards con numero e icona
   ============================================================================= */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
}

.stat-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.stat-card__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* Varianti colore icona */
.stat-card__icon--blue   { background: #E3F2FD; color: var(--icon-blue);   }
.stat-card__icon--teal   { background: #E0F2F1; color: var(--icon-teal);   }
.stat-card__icon--orange { background: #FFF3E0; color: var(--icon-orange); }
.stat-card__icon--green  { background: #E8F5E9; color: var(--icon-green);  }
.stat-card__icon--red    { background: #FFEBEE; color: var(--icon-red);    }
.stat-card__icon--purple { background: #F3E5F5; color: var(--icon-purple); }
.stat-card__icon--cyan   { background: #E0F7FA; color: var(--icon-cyan);   }
.stat-card__icon--amber  { background: #FFF8E1; color: var(--icon-amber);  }
.stat-card__icon--gray   { background: #ECEFF1; color: var(--icon-gray);   }
.stat-card__icon--indigo { background: #E8EAF6; color: var(--icon-indigo); }
.stat-card__icon--pink   { background: #FCE4EC; color: var(--icon-pink);   }
.stat-card__icon--lime   { background: #F1F8E9; color: var(--icon-lime);   }

.stat-card__info {
  flex: 1;
  min-width: 0;
}

.stat-card__number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card__number--warning {
  color: var(--warning);
}

.stat-card__number--danger {
  color: var(--danger);
}

/* Numero con split (es. "10 / 3") */
.stat-card__number-split {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat-card__number-split .main  { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.stat-card__number-split .sep   { font-size: 1rem; color: var(--text-muted); }
.stat-card__number-split .sub   { font-size: 1.1rem; font-weight: 600; color: var(--warning); }

.stat-card__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 400;
}

/* Card in evidenza (es. "Lead" — sfondo colorato) */
.stat-card--featured {
  background: linear-gradient(135deg, #27AE60, #2ECC71);
  border-color: transparent;
  color: white;
}

.stat-card--featured .stat-card__icon {
  background: rgba(255,255,255,0.25);
  color: white;
}

.stat-card--featured .stat-card__number,
.stat-card--featured .stat-card__label {
  color: white;
}

.stat-card--featured:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.35);
}

/* Profilo cards (più alte, testo centrato) */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: box-shadow var(--transition);
  min-height: 90px;
  text-decoration: none;
  color: inherit;
}

.profile-card:hover {
  box-shadow: var(--shadow-card-hover);
  text-decoration: none;
  color: inherit;
}

.profile-card__icon {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.profile-card__value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.profile-card__label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Featured profile card (es. Lead/Carriera) */
.profile-card--featured {
  background: linear-gradient(135deg, #27AE60, #2ECC71);
  border-color: transparent;
}

.profile-card--featured .profile-card__icon,
.profile-card--featured .profile-card__value,
.profile-card--featured .profile-card__label {
  color: white;
}

/* Gruppo di stat cards con header di sezione inline */
.stat-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}

/* =============================================================================
   8. TABELLE
   ============================================================================= */
.task-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.task-table thead tr {
  background: #F8F9FA;
  border-bottom: 2px solid var(--border);
}

.task-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.task-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.task-table tbody tr:hover {
  background: #F8FBFF;
}

.task-table tbody tr:last-child {
  border-bottom: none;
}

.task-table tbody td {
  padding: 10px 14px;
  color: var(--text);
  vertical-align: middle;
}

/* Link ticket nella tabella */
.ticket-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-weight: 500;
  font-size: 0.82rem;
}

.ticket-link:hover {
  text-decoration: underline;
}

.ticket-id {
  background: var(--info-bg);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.78rem;
}

/* =============================================================================
   9. BADGE RUOLO
   ============================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--ceo       { background: #FFEBEE; color: #C62828; }
.badge--manager   { background: #E8EAF6; color: #283593; }
.badge--lead      { background: #E8F5E9; color: #1B5E20; }
.badge--operatore { background: #E3F2FD; color: #0D47A1; }
.badge--admin     { background: #F3E5F5; color: #4A148C; }
.badge--cliente   { background: #FFF3E0; color: #E65100; }
.badge--success   { background: var(--success-bg); color: #1B5E20; }
.badge--warning   { background: var(--warning-bg); color: #E65100; }
.badge--danger    { background: var(--danger-bg);  color: #B71C1C; }
.badge--info      { background: var(--info-bg);    color: #0D47A1; }
.badge--gray      { background: #ECEFF1;            color: #546E7A; }

/* =============================================================================
   10. BOTTONI
   ============================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn--primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3);
  color: white;
}

.btn--success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.btn--success:hover {
  background: #219150;
  color: white;
}

.btn--danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.btn--danger:hover {
  background: #c0392b;
  color: white;
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn--outline:hover {
  background: var(--info-bg);
  color: var(--primary);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--bg);
  color: var(--text);
}

.btn--sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.btn--icon {
  padding: 7px;
  width: 32px;
  height: 32px;
}

/* =============================================================================
   11. FORM ELEMENTS
   ============================================================================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--card-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

.form-control::placeholder {
  color: var(--text-light);
}

/* Select con freccia custom */
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237F8C8D'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* Gruppo inline (es. filtro date) */
.form-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.form-inline .form-label {
  font-size: 0.8rem;
  white-space: nowrap;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-weight: 400;
}

/* =============================================================================
   12. PAGINAZIONE
   ============================================================================= */
.task-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.task-pagination__pages {
  display: flex;
  gap: 4px;
}

.task-pagination__btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.task-pagination__btn:hover {
  background: var(--info-bg);
  color: var(--primary);
  border-color: var(--primary);
}

.task-pagination__btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* =============================================================================
   13. CALENDARIO ATTIVITÀ (widget)
   ============================================================================= */
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.calendar-toolbar label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* =============================================================================
   14. LOADING SKELETON
   ============================================================================= */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #F0F2F5 25%, #E8EAED 50%, #F0F2F5 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

/* =============================================================================
   15. NOTIFICHE TOAST
   ============================================================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-dropdown);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  min-width: 260px;
  max-width: 360px;
  pointer-events: all;
  animation: toastIn 0.25s ease;
}

@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

.toast--success { border-left: 4px solid var(--success); }
.toast--danger  { border-left: 4px solid var(--danger);  }
.toast--warning { border-left: 4px solid var(--warning); }
.toast--info    { border-left: 4px solid var(--primary); }

/* =============================================================================
   16. LOGIN PAGE
   ============================================================================= */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--header-from) 0%, var(--header-to) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-card__logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-card__logo-name {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
}

.login-card__logo-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.login-card__title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

.login-card__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card__footer {
  text-align: center;
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-light);
}

/* =============================================================================
   17. UTILITY
   ============================================================================= */
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-white   { color: white; }
.text-bold    { font-weight: 600; }
.text-sm      { font-size: 0.8rem; }
.text-xs      { font-size: 0.72rem; }

.d-flex   { display: flex; }
.d-none   { display: none; }
.align-center { align-items: center; }
.gap-8    { gap: 8px; }
.gap-12   { gap: 12px; }
.gap-16   { gap: 16px; }
.mt-4     { margin-top: 4px; }
.mt-8     { margin-top: 8px; }
.mt-16    { margin-top: 16px; }
.mb-16    { margin-bottom: 16px; }
.w-full   { width: 100%; }

/* Divisore sezione multi-colonna (es. Analisi ticket + Calendario) */
.dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* =============================================================================
   18. SCROLLBAR CUSTOM
   ============================================================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #A0AEC0; }

/* =============================================================================
   19. RESPONSIVE
   ============================================================================= */
@media (max-width: 1200px) {
  .profile-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .dash-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --content-pad: 14px;
  }

  .task-header__logo-sub { display: none; }

  .profile-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .task-navbar {
    padding: 0 8px;
  }

  .task-nav-link {
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .login-card {
    padding: 28px 20px;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .profile-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* =============================================================================
   MOBILE — Hamburger + Drawer (aggiunto Fase 2)
   ============================================================================= */

/* Hamburger button — nascosto su desktop */
.task-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
  transition: background var(--transition);
  order: -1; /* prima del logo */
}
.task-hamburger:hover { background: rgba(255,255,255,0.25); }

/* Nome utente nell'header — nascosto su schermi piccoli */
.task-header__username {
  font-size: 0.8rem;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Overlay sfondo scuro */
.task-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1500;
  opacity: 0;
  transition: opacity var(--transition-slow);
}
.task-mobile-overlay.open {
  display: block;
  opacity: 1;
}

/* Drawer laterale */
.task-mobile-drawer {
  position: fixed;
  top: 0;
  left: -290px;
  width: 280px;
  height: 100dvh;
  background: var(--card-bg);
  z-index: 1600;
  transition: left var(--transition-slow);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  overflow: hidden;
}
.task-mobile-drawer.open {
  left: 0;
}

/* Intestazione drawer */
.task-mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  background: linear-gradient(135deg, var(--header-from), var(--header-to));
  flex-shrink: 0;
}
.task-mobile-drawer__title {
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 1px;
}
.task-mobile-drawer__close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: background var(--transition);
}
.task-mobile-drawer__close:hover { background: rgba(255,255,255,0.35); }

/* Navigazione verticale nel drawer */
.task-mobile-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}

.task-mobile-nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.task-mobile-nav__item:hover { background: var(--bg); }
.task-mobile-nav__item--danger { color: var(--danger); }

.task-mobile-nav__icon {
  width: 18px;
  text-align: center;
  color: var(--primary);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.task-mobile-nav__item--danger .task-mobile-nav__icon { color: var(--danger); }

.task-mobile-nav__item--parent {
  justify-content: flex-start;
}
.task-mobile-nav__chevron {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.task-mobile-nav__group.open .task-mobile-nav__chevron {
  transform: rotate(180deg);
}

/* Figli del gruppo (accordion) */
.task-mobile-nav__children {
  display: none;
  flex-direction: column;
  background: var(--bg);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.task-mobile-nav__group.open .task-mobile-nav__children {
  display: flex;
}

.task-mobile-nav__child {
  display: block;
  padding: 9px 20px 9px 40px;
  color: var(--text);
  font-size: 0.83rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.task-mobile-nav__child:hover {
  background: var(--info-bg);
  color: var(--primary);
}

.task-mobile-nav__section-label {
  padding: 6px 20px 3px 40px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* =============================================================================
   RESPONSIVE — Breakpoints migliorati
   ============================================================================= */

/* Tablet e mobile: hamburger visibile, navbar desktop nascosta */
@media (max-width: 768px) {
  .task-hamburger { display: flex; }
  .task-navbar    { display: none; }

  /* Body non scorre quando drawer è aperto */
  body.drawer-open { overflow: hidden; }

  /* Header: ridisposizione flex */
  .task-header {
    gap: 10px;
  }
  .task-header__logo-sub { display: none; }
  .task-header__username  { display: none; }

  /* Profilo: cerchio fisso come gli altri pulsanti */
  .task-header__icon-btn--gray {
    width: 36px;
  }

  /* Contenuto */
  .task-body {
    padding-top: var(--header-height); /* no navbar su mobile */
  }

  /* Griglia stat card: 2 colonne su tablet */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Profilo: 2-3 colonne */
  .profile-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Sezioni affiancate → singola colonna */
  .dash-row {
    grid-template-columns: 1fr;
  }

  /* Form inline → wrap */
  .form-inline {
    flex-wrap: wrap;
  }

  /* Tabelle: scroll orizzontale */
  .task-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Padding contenuto ridotto */
  :root { --content-pad: 14px; }
}

/* Smartphone piccoli */
@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .task-header__icon-btn--red,
  .task-header__icon-btn--teal {
    display: none; /* Nasconde alert e chat su schermi molto piccoli */
  }
  :root { --content-pad: 10px; }
}

/* =============================================================================
   20. PAGE LAYOUT — Header pagina e contenuto
   ============================================================================= */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title i {
  color: var(--primary);
  font-size: 1rem;
}

/* =============================================================================
   21. ALERT — Messaggi di stato inline
   ============================================================================= */
.task-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 16px;
  line-height: 1.5;
  border: 1px solid transparent;
}

.task-alert i { flex-shrink: 0; margin-top: 2px; }

.task-alert--warning {
  background: var(--warning-bg);
  border-color: var(--warning-light);
  color: #7A4100;
}
.task-alert--warning i { color: var(--warning); }

.task-alert--danger {
  background: var(--danger-bg);
  border-color: var(--danger-light);
  color: #7B1A1A;
}
.task-alert--danger i { color: var(--danger); }

.task-alert--success {
  background: var(--success-bg);
  border-color: var(--success-light);
  color: #1B5E20;
}
.task-alert--success i { color: var(--success); }

.task-alert--info {
  background: var(--info-bg);
  border-color: var(--primary-lighter);
  color: #0D3C6E;
}
.task-alert--info i { color: var(--primary); }

/* =============================================================================
   22. FORM — Hint e actions
   ============================================================================= */
.form-hint {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-light);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

/* =============================================================================
   23. CP-CARD — Card form cambio password (e form semplici)
   ============================================================================= */
.cp-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 480px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 480px) {
  .cp-card { padding: 20px 16px; }
}

/* =============================================================================
   24. PROFILO — Pagina profilo utente
   ============================================================================= */

/* --- Banner orizzontale --- */
.profilo-header {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.profilo-header__left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

.profilo-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.profilo-header__name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}

.profilo-header__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.profilo-header__dept {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.profilo-header__details {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.79rem;
  color: var(--text-muted);
}

.profilo-header__details i {
  color: var(--primary);
  margin-right: 5px;
}

.profilo-role-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}

.profilo-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition);
  white-space: nowrap;
}
.profilo-logout-btn:hover { background: var(--danger-bg); }

/* --- Card tab --- */
.profilo-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.profilo-card__body {
  padding: 24px;
}

/* --- Tab navigation --- */
.profilo-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  padding: 0 8px;
  background: var(--bg);
}

.profilo-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 11px 18px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  font-family: inherit;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.profilo-tab:hover { color: var(--text); background: var(--card-bg); }
.profilo-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
  background: var(--card-bg);
}

/* --- Tab panels --- */
.profilo-tab-panel        { display: none; }
.profilo-tab-panel.active { display: block; }

/* --- Nome + Cognome affiancati nel form --- */
.profilo-name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

/* --- Form spacing nel profilo --- */
.profilo-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.profilo-form .profilo-name-grid {
  gap: 0 16px;
}
.profilo-form--bordered {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 0;
}
.profilo-form--bordered + .profilo-section-label,
.profilo-form--bordered + .task-table-wrapper,
.profilo-form--bordered + .profilo-empty {
  margin-top: 28px;
}
.form-control--file {
  padding: 7px 10px;
  cursor: pointer;
}

/* --- Griglie form --- */
.profilo-name-grid--3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 16px;
}

/* --- Tabelle dentro le tab del profilo: bordo visibile --- */
.profilo-card__body .task-table-wrapper {
  border: 1px solid var(--border);
  overflow: hidden;
}

/* --- Etichette e stati interni alle tab --- */
.profilo-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.profilo-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 28px 0;
}
.profilo-stato-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.profilo-file-link {
  font-size: 0.78rem;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.profilo-file-link:hover { text-decoration: underline; }
.profilo-doc-icon {
  font-size: 1.3rem;
  margin: 0 3px;
  opacity: .85;
  transition: opacity var(--transition);
}
.profilo-doc-icon:hover { opacity: 1; }

/* --- Modal globale (es. Mansioni) --- */
.task-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.task-modal-overlay.active { display: flex; }
.task-modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.task-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.task-modal__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.task-modal__title i { margin-right: 7px; color: var(--primary); }
.task-modal__close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  font-family: inherit;
}
.task-modal__close:hover { background: var(--danger-bg); color: var(--danger); }
.task-modal__body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.task-modal__footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* --- Sottosezione nel form (es. Notifiche) --- */
.profilo-subsection {
  border-top: 1px solid var(--border);
  padding-top: 22px;
}
.profilo-subsection__title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.profilo-subsection__title i { margin-right: 5px; }
.profilo-subsection__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profilo-subsection__body--row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}
.profilo-subsection__body--row .profilo-toggle {
  flex: 1;
  min-width: 220px;
}

/* --- Toggle switch --- */
.profilo-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  user-select: none;
}
.profilo-toggle:hover { background: var(--border-light); }
.profilo-toggle input[type="checkbox"] { display: none; }
.profilo-toggle__switch {
  width: 42px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition);
}
.profilo-toggle__switch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: left 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.profilo-toggle input[type="checkbox"]:checked ~ .profilo-toggle__switch {
  background: var(--primary);
}
.profilo-toggle input[type="checkbox"]:checked ~ .profilo-toggle__switch::after {
  left: 21px;
}
.profilo-toggle__label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}
.profilo-toggle__desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Paginazione --- */
.profilo-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.pg-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  font-family: inherit;
}
.pg-btn:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pg-btn--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.pg-btn--disabled { opacity: .4; cursor: not-allowed; }
.pg-dots { font-size: 0.85rem; color: var(--text-muted); padding: 0 2px; }
.pg-info { font-size: 0.75rem; color: var(--text-muted); margin-left: 6px; }

/* --- Accordion comunicazioni / circolari --- */
.profilo-comunicazioni {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comunicazione-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.comunicazione-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  background: var(--bg);
  list-style: none;
  color: var(--text);
  transition: background var(--transition);
  user-select: none;
}
.comunicazione-item__header::-webkit-details-marker { display: none; }
.comunicazione-item__header::after {
  content: '\f107';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.comunicazione-item[open] > .comunicazione-item__header::after {
  transform: rotate(180deg);
}
.comunicazione-item__header:hover { background: var(--card-bg-hover); }

.comunicazione-item__header-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.comunicazione-item__title {
  font-size: 0.86rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comunicazione-item__mittente {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.comunicazione-item__mittente i {
  margin-right: 4px;
  font-size: 0.7rem;
}
.comunicazione-item__date {
  font-size: 0.77rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.comunicazione-item__body {
  padding: 12px 16px 14px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .profilo-header              { flex-direction: column; align-items: flex-start; }
  .profilo-name-grid           { grid-template-columns: 1fr; }
  .profilo-name-grid--3        { grid-template-columns: 1fr; }
  .profilo-card__body          { padding: 16px; }
  .profilo-header__details     { gap: 10px; }
  .profilo-form--bordered      { padding: 14px; }
}

/* =============================================================================
   Navbar — classi per rimuovere stili inline
   ============================================================================= */
.task-dropdown__header {
  padding: 6px 16px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
}
.task-dropdown__bullet       { font-size: 0.65rem; opacity: 0.5; }
.task-mobile-nav__bullet     { font-size: 0.6rem;  opacity: 0.4; margin-right: 4px; }
.task-mobile-nav__item--logout { margin-top: auto; border-top: 1px solid var(--border-light); }

/* =============================================================================
   Header — profilo dropdown
   ============================================================================= */
.task-header__profile-btn      { width: auto; border-radius: 20px; padding: 0 14px; gap: 8px; }
.task-header__profile-btn i    { color: #fff; }
.task-header__profile-name     { font-size: 0.88rem; font-weight: 500; white-space: nowrap; color: #fff; }
.task-header__profile-dropdown { right: 0; left: auto; min-width: 220px; border-radius: var(--radius); }
.task-header__profile-info     { padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
.task-header__profile-fullname { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.task-header__profile-role     { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.task-header__profile-email    { font-size: 0.72rem; color: var(--text-light); margin-top: 2px; }
.task-dropdown__item--danger       { color: var(--danger); }
.task-dropdown__item--danger i     { color: var(--danger); }
.mansioni-textarea { resize: none; background: var(--bg-alt, #f5f7fa); cursor: default; min-height: 80px; overflow-y: auto; }

/* =============================================================================
   Footer bar
   ============================================================================= */
.task-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-light);
}

/* =============================================================================
   Admin navbar — classi per rimuovere stili inline
   ============================================================================= */
.task-nav-link--muted          { color: var(--text-muted); }
.task-nav-back-icon            { font-size: 0.8rem; }
.task-nav-divider              { width: 1px; background: var(--border); margin: 8px 4px; align-self: stretch; }
.task-mobile-nav__item--back   { border-bottom: 1px solid var(--border-light); margin-bottom: 4px; }
