/* assets/css/app.css
   ═══════════════════════════════════════════════════════════════
   LeadGold — Design System v7
   Ispirato a Linear/Attio/Notion. Vanilla CSS, zero framework.
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. TOKEN ─────────────────────────────────────────────── */
:root{
  /* Colori base — sovrascrivibili da Settings::brandingCss() */
  --primary: #b8862d;
  --primary-2: #c19638;
  --primary-3: #9d6f22;
  --primary-soft: #b8862d14;
  --primary-line: #b8862d33;
  --accent: #3b82f6;

  --sb-bg: #0f0d0a;
  --sb-bg-2: #1a1712;
  --sb-bg-3: #262019;
  --sb-fg: #a8a094;
  --sb-fg-2: #6b665c;

  /* Canvas */
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f3f3f4;

  /* Testo */
  --ink: #0f172a;
  --ink-2: #475569;
  --muted: #94a3b8;

  /* Bordi */
  --border: #e5e7eb;
  --border-2: #d1d5db;
  --border-3: #cbd5e1;

  /* Semantici */
  --success: #10b981;
  --success-soft: #10b98115;
  --warning: #f59e0b;
  --warning-soft: #f59e0b15;
  --danger: #ef4444;
  --danger-soft: #ef444415;
  --info: #3b82f6;
  --info-soft: #3b82f615;

  /* Ombre */
  --sh-xs: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --sh-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --sh-md: 0 4px 12px -2px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --sh-lg: 0 12px 32px -8px rgb(0 0 0 / 0.14), 0 4px 12px -4px rgb(0 0 0 / 0.06);

  /* Font */
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Sora', 'Inter', sans-serif;

  /* Layout */
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --pad: 20px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"]{
  --bg: #0a0908;
  --surface: #14110d;
  --surface-2: #1a1712;
  --surface-3: #221e17;
  --ink: #f4f2ec;
  --ink-2: #c9c3b5;
  --muted: #7a7466;
  --border: #2a251e;
  --border-2: #3a3428;
  --border-3: #4a4232;
}

[data-density="compact"]{
  --pad: 14px;
  --radius: 8px;
  --topbar-h: 52px;
}

/* ─── 2. RESET & BASE ───────────────────────────────────────── */
*{ box-sizing: border-box; margin: 0; padding: 0; }
html{ -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body{
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}
h1,h2,h3,h4,h5,.font-heading{ font-family: var(--font-heading); font-weight: 700; letter-spacing: -0.01em; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; cursor: pointer; }
img,svg{ display: block; max-width: 100%; }
.hidden{ display: none !important; }

/* Scrollbar */
::-webkit-scrollbar{ width: 10px; height: 10px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{ background: var(--border-2); border-radius: 6px; border: 2px solid var(--bg); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover{ background: var(--muted); background-clip: padding-box; }

/* Focus visibile e coerente */
:focus-visible{ outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible{ outline-offset: 3px; }

/* ─── 3. LAYOUT SHELL ───────────────────────────────────────── */
.app{ display: flex; min-height: 100vh; }

.sidebar{
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--sb-bg); color: var(--sb-fg);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 40;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.sidebar-brand{
  padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 12px;
}
.brand-logo{ display: inline-flex; align-items: center; gap: 10px; }
.brand-logo-img{ height: 32px; width: auto; border-radius: 6px; }
.brand-glyph{
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-2), var(--primary-3));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: 0 4px 12px -2px var(--primary-soft);
}
.brand-name{ font-family: var(--font-heading); font-weight: 700; font-size: 16px; color: #fff; letter-spacing: -0.02em; }

.sidebar-nav{ flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar-nav::-webkit-scrollbar-thumb{ background: var(--sb-bg-3); border-color: var(--sb-bg); }

.nav-section{ margin-bottom: 4px; }
.nav-section-title{
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--sb-fg-2);
  padding: 12px 12px 6px;
}
.nav-item{
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: 8px;
  color: var(--sb-fg); font-weight: 500; font-size: 14px;
  transition: background 0.15s var(--ease-out), color 0.15s;
  position: relative;
}
.nav-item .ico{ width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover{ background: var(--sb-bg-2); color: #fff; }
.nav-item.active{ background: var(--sb-bg-2); color: #fff; }
.nav-item.active::before{
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--primary-2), var(--primary-3));
}
.nav-badge{ margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; background: var(--primary); color: #fff; }

.sidebar-foot{
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 12px; display: flex; align-items: center; gap: 10px;
}
.sidebar-user{
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px; min-width: 0;
  transition: background 0.15s;
}
.sidebar-user:hover{ background: var(--sb-bg-2); }
.avatar{
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; color: #fff;
  font-size: 12px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary-2), var(--primary-3));
}
.avatar-sm{ width: 24px; height: 24px; font-size: 10px; }
.avatar-lg{ width: 56px; height: 56px; font-size: 18px; }
.sidebar-user-info{ min-width: 0; }
.sidebar-user-name{ color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role{ color: var(--sb-fg-2); font-size: 11px; text-transform: capitalize; }
.icon-btn{
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  background: transparent; border: none; color: var(--sb-fg);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover{ background: var(--sb-bg-2); color: #fff; }
.icon-btn.danger:hover{ background: var(--danger); color: #fff; }

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

/* ─── 4. TOPBAR ─────────────────────────────────────────────── */
.topbar{
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-search{ position: relative; flex: 1; max-width: 480px; }
.topbar-search .ico{ position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.topbar-search input{ padding-left: 38px; height: 36px; background: var(--surface); border-radius: 8px; }
.topbar-right{ margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-btn{
  height: 36px; min-width: 36px; padding: 0 8px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.15s;
  position: relative;
}
.topbar-btn:hover{ border-color: var(--border-3); color: var(--ink); }
.topbar-btn .dot{
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface);
}

.sidebar-toggle{
  display: none;
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
}

/* ─── 5. PAGINA ─────────────────────────────────────────────── */
.page{
  padding: 24px var(--pad);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
.page-head{
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.page-title{
  font-family: var(--font-heading); font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
}
.page-title small{
  display: block; font-family: var(--font-body); font-weight: 400;
  color: var(--muted); font-size: 13px; margin-top: 4px; letter-spacing: 0;
}
.page-actions{ display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ─── 6. BOTTONI ────────────────────────────────────────────── */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: inherit; background: transparent;
  transition: all 0.15s var(--ease-out);
  white-space: nowrap; user-select: none;
}
.btn:disabled{ opacity: 0.5; cursor: not-allowed; }
.btn .ico{ width: 16px; height: 16px; }

.btn-primary{
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  color: #fff;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.1), inset 0 -1px 0 rgb(0 0 0 / 0.1);
}
.btn-primary:hover:not(:disabled){ box-shadow: 0 4px 12px -2px var(--primary-soft), inset 0 -1px 0 rgb(0 0 0 / 0.1); transform: translateY(-1px); }

.btn-secondary{
  background: var(--surface); border-color: var(--border);
  color: var(--ink);
  box-shadow: var(--sh-xs);
}
.btn-secondary:hover:not(:disabled){ background: var(--surface-2); border-color: var(--border-2); }

.btn-ghost{
  background: transparent; color: var(--ink-2);
}
.btn-ghost:hover:not(:disabled){ background: var(--surface-3); color: var(--ink); }

.btn-danger{
  background: var(--surface); border-color: var(--border);
  color: var(--danger);
}
.btn-danger:hover:not(:disabled){ background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-sm{ height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-lg{ height: 44px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn-icon{ width: 36px; padding: 0; }
.btn-icon.btn-sm{ width: 28px; }
.btn-block{ width: 100%; }

/* ─── 7. INPUT ──────────────────────────────────────────────── */
.input, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="tel"], input[type="url"],
input[type="date"], input[type="datetime-local"], select, textarea{
  height: 36px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 13px; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
textarea{ height: auto; min-height: 80px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus{ outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input::placeholder, textarea::placeholder{ color: var(--muted); }
select{ padding-right: 32px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.field{ display: flex; flex-direction: column; gap: 6px; }
.field label{ font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .hint{ font-size: 11px; color: var(--muted); }
.field-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.input-icon{ position: relative; }
.input-icon > .ico{ position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input{ padding-left: 38px; }

/* ─── 8. CARD / PANEL ───────────────────────────────────────── */
.card, .panel{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--sh-xs);
}
.card{ padding: 20px; }
.card-hover{ transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s; }
.card-hover:hover{ box-shadow: var(--sh-md); border-color: var(--border-2); transform: translateY(-1px); }
.panel{ padding: 20px; }
.panel-header{
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 16px;
}
.panel-header h2{ font-family: var(--font-heading); font-size: 15px; font-weight: 700; }

/* ─── 9. BADGE / CHIP / PILL ────────────────────────────────── */
.badge{
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  background: var(--surface-3); color: var(--ink-2);
  border: 1px solid transparent;
}
.badge-primary{ background: var(--primary-soft); color: var(--primary-3); }
.badge-success{ background: var(--success-soft); color: var(--success); }
.badge-warning{ background: var(--warning-soft); color: var(--warning); }
.badge-danger{ background: var(--danger-soft); color: var(--danger); }
.badge-info{ background: var(--info-soft); color: var(--info); }

.chip{
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 4px 8px; border-radius: 6px;
  background: var(--surface-3); color: var(--ink-2);
  border: 1px solid var(--border);
}
.chip .ico{ width: 12px; height: 12px; }

.dot{ display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot-success{ background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot-warning{ background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.dot-danger{ background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot-info{ background: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.dot-live{ background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); animation: pulse 2s infinite; }
@keyframes pulse{ 0%,100%{ opacity: 1; } 50%{ opacity: 0.5; } }

/* ─── 10. TABELLE ────────────────────────────────────────────── */
.tbl{ width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th{
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.tbl td{ padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr{ transition: background 0.12s; }
.tbl tbody tr:hover{ background: var(--surface-2); }
.tbl tbody tr:last-child td{ border-bottom: none; }

/* ─── 11. MODAL / DRAWER ────────────────────────────────────── */
.modal-overlay{
  position: fixed; inset: 0; z-index: 100;
  background: rgb(0 0 0 / 0.5);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn 0.15s var(--ease-out);
}
@keyframes fadeIn{ from{ opacity: 0; } }
.modal{
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--sh-lg);
  max-width: 480px; width: 100%; max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.2s var(--ease-out);
}
@keyframes modalIn{
  from{ opacity: 0; transform: translateY(12px) scale(0.98); }
}
.modal-header{
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal-header h3{ font-family: var(--font-heading); font-size: 16px; font-weight: 700; }
.modal-body{ padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer{
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}

.drawer{
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(440px, 100%); z-index: 100;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--sh-lg);
  transform: translateX(100%);
  transition: transform 0.3s var(--ease-out);
  display: flex; flex-direction: column;
}
.drawer.open{ transform: none; }
.drawer-header{
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.drawer-body{ flex: 1; overflow-y: auto; padding: 20px; }

/* ─── 12. TOAST ─────────────────────────────────────────────── */
.toast-stack{
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast{
  min-width: 280px; max-width: 400px;
  padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--sh-lg);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px;
  animation: toastIn 0.2s var(--ease-out);
  border-left: 3px solid var(--primary);
}
.toast.success{ border-left-color: var(--success); }
.toast.warning{ border-left-color: var(--warning); }
.toast.error{ border-left-color: var(--danger); }
.toast .ico{ flex-shrink: 0; margin-top: 1px; }
.toast.success .ico{ color: var(--success); }
.toast.warning .ico{ color: var(--warning); }
.toast.error .ico{ color: var(--danger); }
@keyframes toastIn{
  from{ opacity: 0; transform: translateX(20px); }
}

/* ─── 13. STAT CARDS ─────────────────────────────────────────── */
.stat-grid{
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card{
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.stat-card:hover{ box-shadow: var(--sh-sm); border-color: var(--border-2); }
.stat-card-head{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-icon{
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-3);
}
.stat-icon.success{ background: var(--success-soft); color: var(--success); }
.stat-icon.info{ background: var(--info-soft); color: var(--info); }
.stat-icon.warning{ background: var(--warning-soft); color: var(--warning); }
.stat-value{
  font-family: var(--font-heading); font-size: 28px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1; margin-bottom: 6px;
}
.stat-label{ font-size: 13px; font-weight: 500; color: var(--ink-2); }
.stat-delta{ font-size: 11px; color: var(--muted); margin-top: 6px; }
.stat-delta.up{ color: var(--success); }
.stat-delta.down{ color: var(--danger); }

/* ─── 14. TABS ──────────────────────────────────────────────── */
.tabs{
  display: inline-flex; gap: 4px;
  padding: 4px; background: var(--surface-3);
  border-radius: 10px; margin-bottom: 20px;
}
.tabs button{
  height: 32px; padding: 0 14px;
  background: transparent; border: none;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-2); border-radius: 6px;
  transition: all 0.15s var(--ease-out);
}
.tabs button:hover{ color: var(--ink); }
.tabs button.active{ background: var(--surface); color: var(--ink); box-shadow: var(--sh-xs); }

/* ─── 15. LOGIN ─────────────────────────────────────────────── */
.login-page{
  min-height: 100vh; display: grid; place-items: center;
  padding: 20px; position: relative; overflow: hidden;
  background: radial-gradient(ellipse at top left, var(--primary-soft), transparent 60%),
              radial-gradient(ellipse at bottom right, var(--accent)10, transparent 60%),
              var(--bg);
}
.login-card{
  position: relative; z-index: 2;
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  box-shadow: var(--sh-lg);
  display: flex; flex-direction: column; gap: 16px;
  animation: modalIn 0.3s var(--ease-out);
}
.login-brand{
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.login-brand .brand-glyph{ width: 44px; height: 44px; font-size: 18px; }
.login-brand .brand-name{ color: var(--ink); font-size: 20px; }
.login-title{ font-family: var(--font-heading); font-size: 22px; font-weight: 700; margin-top: 8px; }
.login-sub{ color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.alert{
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--danger-soft); color: #b91c1c;
  border: 1px solid #ef444433;
  font-size: 13px;
}

/* ─── 16. SKELETON ──────────────────────────────────────────── */
.skeleton{
  background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
  border-radius: 6px; color: transparent !important;
}
@keyframes shimmer{ 0%{ background-position: 200% 0; } 100%{ background-position: -200% 0; } }

/* ─── 17. EMPTY STATE ───────────────────────────────────────── */
.empty{
  text-align: center; padding: 40px 20px;
  color: var(--muted);
}
.empty-icon{
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 14px; background: var(--surface-3);
  display: grid; place-items: center; color: var(--muted);
}
.empty-icon .ico{ width: 24px; height: 24px; }
.empty-title{ font-family: var(--font-heading); font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.empty-text{ font-size: 13px; }

/* ─── 18. RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 960px){
  .sidebar{
    position: fixed; left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-out);
    box-shadow: var(--sh-lg);
  }
  .sidebar.open{ transform: none; }
  .sidebar-toggle{ display: inline-flex; align-items: center; justify-content: center; }
  .topbar{ padding-left: 60px; }
  .field-row{ grid-template-columns: 1fr; }
}
.sidebar-backdrop{
  display: none;
  position: fixed; inset: 0; z-index: 30;
  background: rgb(0 0 0 / 0.4);
}
.sidebar.open ~ .sidebar-backdrop{ display: block; }

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── 19. UTILITY ───────────────────────────────────────────── */
.flex{ display: flex; }
.grid{ display: grid; }
.items-center{ align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-1{ gap: 4px; } .gap-2{ gap: 8px; } .gap-3{ gap: 12px; } .gap-4{ gap: 16px; }
.mt-1{ margin-top: 4px; } .mt-2{ margin-top: 8px; } .mt-3{ margin-top: 12px; } .mt-4{ margin-top: 16px; }
.text-muted{ color: var(--muted); }
.text-xs{ font-size: 11px; } .text-sm{ font-size: 13px; } .text-lg{ font-size: 16px; }
.font-medium{ font-weight: 500; } .font-semibold{ font-weight: 600; } .font-bold{ font-weight: 700; }
.truncate{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ─── FIX: topbar search — icona non deve sovrapporsi al testo ─── */
.topbar-search input[type="search"]{ padding-left: 38px; }
/* Assicura che qualsiasi input dentro .input-icon abbia spazio per l'icona */
.input-icon input[type="text"],
.input-icon input[type="email"],
.input-icon input[type="password"],
.input-icon input[type="search"],
.input-icon input[type="tel"]{
    padding-left: 38px;
}
/* ─── Alert compatto dentro il composer chat ─── */
.chat-composer .alert{
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 8px;
    display: flex; align-items: center; gap: 8px;
    border: 1px solid;
}