* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  height: 100vh;
  overflow: hidden;
}

.layout {
  display: flex;
  height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: #1a1a2e;
  color: #e0e0e0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #2d2d4e;
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid #2d2d4e;
}

.sidebar-header h1 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.3px;
}

.sidebar-header p {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

.clienti-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.cliente-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s;
}

.cliente-item:hover { background: #252545; }

.gruppo-data {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #555;
  padding: 10px 16px 4px;
  margin-top: 4px;
}
.gruppo-data:first-child { margin-top: 0; }

.gruppo-collassabile {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}
.gruppo-collassabile:hover { color: #888; }
.gruppo-arrow { font-style: normal; width: 10px; flex-shrink: 0; }
.gruppo-count {
  margin-left: auto;
  font-size: 9px;
  background: #2d2d4e;
  color: #666;
  padding: 1px 5px;
  border-radius: 8px;
}

.cliente-item.active {
  background: #252545;
  border-left-color: #4f8ef7;
}

.cliente-item .nome {
  font-size: 13px;
  font-weight: 500;
  color: #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cliente-item .badge {
  font-size: 10px;
  background: #2d2d4e;
  color: #888;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.cliente-item.active .badge { background: #4f8ef7; color: #fff; }

/* ── Monitor status (sidebar) ────────────────────────────────── */
.monitor-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-bottom: 1px solid #2d2d4e;
  font-size: 11px;
  color: #888;
  min-height: 32px;
}

.monitor-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #444;
  flex-shrink: 0;
}
.monitor-dot.active {
  background: #10b981;
  box-shadow: 0 0 5px #10b98166;
  animation: pulse-dot 2s infinite;
}
.monitor-dot.paused { background: #f59e0b; }
.monitor-dot.error  { background: #ef4444; }
.monitor-dot.processing {
  background: #6366f1;
  box-shadow: 0 0 5px #6366f166;
  animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid #2d2d4e;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-secondary {
  width: 100%;
  padding: 8px;
  background: #252545;
  color: #bbb;
  border: 1px solid #3a3a5c;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s;
}
.btn-secondary:hover { background: #2d2d4e; color: #fff; }

/* ── Main ────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 14px;
}

/* ── Header cliente ──────────────────────────────────────── */
.cliente-header {
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cliente-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.cliente-header .ticket-count {
  font-size: 12px;
  color: #888;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0 24px;
}

.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}

.tab:hover { color: #4f8ef7; }
.tab.active { color: #4f8ef7; border-bottom-color: #4f8ef7; }

/* ── Content area ────────────────────────────────────────── */
.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: none;
}
.tab-content.active { display: flex; flex-direction: column; gap: 20px; }

/* ── Sezioni ─────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.15s;
  outline: none;
}
textarea:focus { border-color: #4f8ef7; }

.btn-primary {
  padding: 9px 20px;
  background: #4f8ef7;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-primary:hover { background: #3b7de8; }
.btn-primary:disabled { background: #a0bcf3; cursor: not-allowed; }

.btn-save {
  padding: 7px 16px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-save:hover { background: #059669; }

/* ── Risposta Claude ─────────────────────────────────────── */
.risposta-box {
  background: #f8faff;
  border: 1px solid #c7d9ff;
  border-radius: 6px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  display: none;
}
.risposta-box.visible { display: block; }

.loading-spinner {
  display: none;
  align-items: center;
  gap: 8px;
  color: #888;
  font-size: 13px;
}
.loading-spinner.visible { display: flex; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d1d5db;
  border-top-color: #4f8ef7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Storico email ───────────────────────────────────────── */
.ticket-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.ticket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f9fafb;
  cursor: pointer;
  user-select: none;
}

.ticket-header:hover { background: #f3f4f6; }

.ticket-title { font-size: 13px; font-weight: 500; }
.ticket-date { font-size: 11px; color: #888; }
.ticket-toggle { color: #888; font-size: 12px; }

.btn-delete-ticket {
  background: none;
  border: none;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.35;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity .15s, background .15s;
}
.btn-delete-ticket:hover { opacity: 1; background: #fee2e2; }

.ticket-body { display: none; padding: 16px; background: #fff; }
.ticket-body.open { display: block; }

.ticket-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  margin-top: 12px;
}
.ticket-section-label:first-child { margin-top: 0; }

.ticket-text {
  font-size: 12px;
  line-height: 1.6;
  color: #333;
  white-space: pre-wrap;
  background: #f9fafb;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
}

.no-sol {
  font-size: 12px;
  color: #f59e0b;
  background: #fef3c7;
  padding: 6px 10px;
  border-radius: 4px;
}

/* Stato ticket nella testata */
.ticket-status {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ticket-status.done    { color: #10b981; }
.ticket-status.waiting { color: #f59e0b; }
.ticket-status.processing { color: #6366f1; }

.ticket-item.ticket-processing {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 2px #eef2ff;
}

.mini-spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.5px solid #c7d3fd;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* ── Chat ────────────────────────────────────────────────── */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100px;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 90%;
  white-space: pre-wrap;
}

.msg.user {
  background: #4f8ef7;
  color: #fff;
  align-self: flex-end;
}

.msg.assistant {
  background: #f3f4f6;
  color: #1a1a2e;
  align-self: flex-start;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.chat-input-row textarea {
  flex: 1;
  resize: none;
  min-height: 40px;
  max-height: 120px;
}

.chat-msg-like {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #d1d5db;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Note ────────────────────────────────────────────────── */
.note-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.save-feedback {
  font-size: 12px;
  color: #10b981;
  display: none;
}
.save-feedback.visible { display: inline; }

/* ── Mi piace / Salva verificata ─────────────────────────── */
.btn-like {
  padding: 6px 14px;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-like:hover { background: #a7f3d0; }

.btn-like-small {
  padding: 2px 8px;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-like-small:hover { background: #a7f3d0; }

.like-feedback {
  font-size: 12px;
  color: #10b981;
  display: none;
}
.like-feedback.visible { display: inline; }

/* ── Markdown rendering ──────────────────────────────────── */
.risposta-box, .md-content, .msg.assistant {
  white-space: normal;
}

.risposta-box p, .md-content p, .msg.assistant p { margin-bottom: 8px; }
.risposta-box p:last-child, .md-content p:last-child, .msg.assistant p:last-child { margin-bottom: 0; }

.risposta-box h1, .risposta-box h2, .risposta-box h3,
.md-content h1, .md-content h2, .md-content h3,
.msg.assistant h1, .msg.assistant h2, .msg.assistant h3 {
  margin: 12px 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
}

.risposta-box ul, .risposta-box ol,
.md-content ul, .md-content ol,
.msg.assistant ul, .msg.assistant ol {
  padding-left: 20px;
  margin-bottom: 8px;
}

.risposta-box li, .md-content li, .msg.assistant li { margin-bottom: 2px; }

.risposta-box table, .md-content table, .msg.assistant table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 12px;
}
.risposta-box th, .risposta-box td,
.md-content th, .md-content td,
.msg.assistant th, .msg.assistant td {
  border: 1px solid #d1d5db;
  padding: 5px 8px;
  text-align: left;
}
.risposta-box th, .md-content th, .msg.assistant th {
  background: #f3f4f6;
  font-weight: 600;
}

.risposta-box a, .md-content a, .msg.assistant a {
  color: #4f8ef7;
  text-decoration: underline;
}
.risposta-box a:hover, .md-content a:hover, .msg.assistant a:hover {
  color: #2563eb;
}

.risposta-box code, .md-content code, .msg.assistant code {
  background: #f0f2f5;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 11px;
}

.risposta-box pre, .md-content pre, .msg.assistant pre {
  background: #f0f2f5;
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 8px;
}
.risposta-box pre code, .md-content pre code, .msg.assistant pre code {
  background: none;
  padding: 0;
}

/* ── Modal monitor ───────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 10px;
  width: 480px;
  max-width: 96vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
}
.modal-close {
  background: none;
  border: none;
  font-size: 16px;
  color: #888;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.modal-close:hover { background: #f3f4f6; color: #333; }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
}

.modal-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}
.form-row label {
  font-size: 12px;
  color: #555;
  font-weight: 500;
}
.form-row input[type="text"],
.form-row input[type="number"] {
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.form-row input:focus { border-color: #4f8ef7; }

.btn-monitor {
  color: #aaa;
}
.btn-monitor:hover { color: #fff; }

.btn-pulizia {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 6px 0;
  font-size: 12px;
  color: #e57373;
  cursor: pointer;
  transition: color 0.15s;
}
.btn-pulizia:hover { color: #ef4444; }

.btn-danger {
  padding: 9px 20px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s;
}
.btn-danger:hover { background: #dc2626; }

.device-code-box {
  background: #f8faff;
  border: 1px solid #c7d9ff;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 10px;
}
.device-code-link {
  color: #4f8ef7;
  font-size: 13px;
  word-break: break-all;
}
.device-code-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #1a1a2e;
  margin: 4px 0 8px;
  font-family: monospace;
}
.spinner-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.monitor-error {
  color: #ef4444;
  font-size: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 4px 8px;
  margin-top: 4px;
}

/* ── Nuovi ticket ─────────────────────────────────────────────── */
.new-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  animation: pulse-dot 2s infinite;
}

.cliente-item.has-new .nome { color: #fff; }

.new-tickets-banner {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.badge-new {
  display: inline-block;
  background: #10b981;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: .5px;
  vertical-align: middle;
  margin-right: 2px;
}

.ticket-item.ticket-new {
  border-color: #6ee7b7;
  box-shadow: 0 0 0 1px #6ee7b7;
}

.ticket-item.ticket-new .ticket-header {
  background: #f0fdf4;
}

/* ── DocHub ──────────────────────────────────────────────── */
.dochub-status {
  padding: 6px 12px;
  margin: 0 8px 4px;
  background: #2d2d4e;
  border-radius: 6px;
  font-size: 12px;
  color: #a0aec0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .15s;
}
.dochub-status:hover { background: #3d3d5e; color: #e0e0e0; }

.dochub-badge {
  background: #f59e0b;
  color: #1a1a2e;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.dochub-item {
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 6px;
  background: #fff;
}

.dochub-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.dochub-tag.new {
  background: #d1fae5;
  color: #065f46;
}
.dochub-tag.updated {
  background: #fef3c7;
  color: #92400e;
}

/* ── Contesto chat ───────────────────────────────────────── */
.chat-contesto {
  font-size: 12px;
  color: #9ca3af;
  padding: 5px 8px;
  margin-bottom: 8px;
  border-radius: 4px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}
.chat-contesto.attivo {
  color: #4f46e5;
  background: #f0f0ff;
  border-color: #c7c3ff;
}

/* ── Sessione per-ticket ─────────────────────────────────── */
.ticket-sessione {
  margin-top: 14px;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}

.sess-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-sessione-toggle {
  font-size: 11px;
  padding: 3px 10px;
  background: #f0f4ff;
  border: 1px solid #c7d9ff;
  border-radius: 4px;
  color: #4f8ef7;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-sessione-toggle:hover { background: #dde8ff; }

.sessione-body { margin-top: 10px; }

.sess-chat {
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sess-input-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  margin-top: 8px;
}
.sess-input-row textarea { flex: 1; min-height: 60px; }

.btn-attach {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-attach:hover { background: #f3f4f6; }

.sess-fname {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  align-self: center;
}

.sess-allegati-list {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: #f9fafb;
  border-radius: 4px;
}
.sess-allegati-list a { color: #6366f1; text-decoration: none; }
.sess-allegati-list a:hover { text-decoration: underline; }

/* ── Sidebar footer ──────────────────────────────────────── */
.sidebar-footer-row {
  display: flex;
  gap: 6px;
}
.btn-footer-half {
  flex: 1;
  font-size: 11px;
  padding: 7px 4px;
}
.btn-studio {
  color: #c4b5fd;
  border-color: #4a3a7a;
}
.btn-studio:hover { background: #3d2d6e; color: #fff; }

/* ── Studio in sidebar ───────────────────────────────────── */
.cliente-item.is-studio {
  border-left-color: transparent;
  background: #1f1f42;
}
.cliente-item.is-studio .nome { color: #c4b5fd; }
.cliente-item.is-studio .badge { background: #3d2d6e; color: #c4b5fd; }
.cliente-item.is-studio.active { border-left-color: #a78bfa; }
.cliente-item.is-studio.active .badge { background: #a78bfa; color: #fff; }

.studio-icon { font-size: 11px; }

/* Hint visivo: quando si inizia a trascinare, gli studi si illuminano */
.cliente-item.is-studio.studio-drop-hint {
  background: #2a1f5e;
  border-left-color: #7c3aed;
}
.cliente-item.is-studio.studio-drop-hint .nome { color: #ddd6fe; }

/* Drop attivo: hover mentre si trascina sul target */
.cliente-item.is-studio.studio-drop-over {
  background: #3d2d6e;
  border-left-color: #a78bfa;
  box-shadow: inset 0 0 0 2px #7c3aed44;
}
.cliente-item.is-studio.studio-drop-over .nome { color: #fff; }

/* ── Sidebar search ──────────────────────────────────────── */
.sidebar-search-wrap {
  padding: 8px 10px 4px;
}
.sidebar-search {
  width: 100%;
  padding: 7px 10px;
  background: #252545;
  border: 1px solid #3a3a5c;
  border-radius: 6px;
  color: #ddd;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.sidebar-search::placeholder { color: #555; }
.sidebar-search:focus { border-color: #6366f1; background: #2d2d4e; }

/* Risultati ricerca (sotto la lista clienti, nella sidebar) */
.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.search-loading, .search-empty {
  font-size: 12px;
  color: #666;
  padding: 12px 16px;
}
.search-item {
  padding: 9px 14px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background .15s;
}
.search-item:hover {
  background: #252545;
  border-left-color: #4f8ef7;
}
.search-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.search-item-cliente {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #6366f1;
}
.search-item-data {
  font-size: 10px;
  color: #555;
}
.search-item-titolo {
  font-size: 12px;
  font-weight: 500;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-item-snippet {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tasto elimina studio */
.btn-delete-studio {
  background: none;
  border: none;
  font-size: 15px;
  line-height: 1;
  color: #7c3aed;
  cursor: pointer;
  opacity: 0;
  padding: 1px 4px;
  border-radius: 4px;
  transition: opacity .15s, background .15s, color .15s;
}
.cliente-item.is-studio:hover .btn-delete-studio { opacity: 0.6; }
.btn-delete-studio:hover { opacity: 1 !important; background: #4c1d95; color: #fff; }

/* Pulsante mostra vecchi ticket */
.btn-mostra-vecchi {
  display: block;
  width: 100%;
  margin: 8px 0 4px;
  padding: 8px 12px;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  color: #6b7280;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  transition: background .15s, color .15s;
}
.btn-mostra-vecchi:hover { background: #f3f4f6; color: #374151; }

/* Sidebar item mentre si trascina */
.cliente-item.dragging {
  opacity: 0.45;
  cursor: grabbing;
}
