:root {
  /* Tech Chrome Light Theme — Variante 26 */
  --bg: #eef2f5;
  --bg-2: #f8fafb;
  --bg-3: #dce4eb;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --text: #17222d;
  --text-2: #6f7b87;
  --accent: #2f7fd8;
  --accent-2: #266ab4;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --info: #2f7fd8;
  --border: #dce3e9;
  --radius: 12px;
  --shadow: 0 12px 28px rgba(49, 62, 76, 0.09);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select { font: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 8px; font-weight: 700; }
h3 { font-size: 15px; }
h4 { font-size: 13px; }

.app { display: flex; height: 100vh; overflow: hidden; }
.app[hidden], .login-view[hidden] { display: none !important; }

/* Sidebar */
.sidebar {
  width: 212px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
  font-size: 13px;
}
.sidebar-header {
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(180deg, #ffffff, #cdd6df 48%, #f7f9fb);
  border: 1px solid #c7d0d8;
  box-shadow: inset 0 1px 0 #fff, 0 5px 10px rgba(56, 70, 84, 0.1);
}
.brand-text { font-weight: 700; line-height: 1.15; color: #ffffff; font-size: 13px; }
.brand-text span { display: block; font-size: 9px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.07em; }

.nav { flex: 1; padding: 8px; overflow-y: auto; }
.nav-item {
  width: 100%;
  display: flex; align-items: center; gap: 9px;
  /* I bottoni centrano il testo per conto loro: con una riga sola non si nota,
     ma una voce che va a capo esce centrata in mezzo a tutte le altre
     allineate a sinistra. */
  text-align: left;
  padding: 8px 9px;
  margin-bottom: 3px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: #e8f1fb; color: #2f6fae; }
@keyframes navPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); background: rgba(239, 68, 68, 0.08); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); background: rgba(239, 68, 68, 0.18); }
}
.nav-pulse {
  animation: navPulse 1.2s infinite;
  color: #dc2626 !important;
  font-weight: 700;
}
.nav-pulse .nav-icon {
  background: #dc2626 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 3px 10px rgba(220, 38, 38, .4) !important;
}
.nav-icon {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 8px rgba(20, 30, 45, .18);
}
.nav-icon img { width: 68%; height: 68%; object-fit: contain; display: block; }
.nav-icon svg { width: 15px; height: 15px; display: block; }
.nav-group { margin-top: 7px; }
.nav-group-toggle {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 9px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  cursor: pointer;
  transition: all .15s;
}
.nav-group-toggle:hover { background: var(--bg-3); color: var(--text); }
.nav-group-toggle.expanded { color: var(--accent); }
.nav-group-arrow { font-size: 9px; }
.nav-group-items { padding-left: 5px; }
.nav-group-empty { margin: 0; padding: 5px 9px; font-size: 11px; }

.sidebar-footer { padding: 8px; border-top: 1px solid var(--border); }
.ai-shortcut {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: rgba(47, 127, 216, 0.08);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.ai-shortcut:hover { background: rgba(47, 127, 216, 0.16); }

/* Main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); overflow-x: hidden; }
.topbar {
  height: 54px;
  padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 14px;
}
.topbar-title h1 { margin: 0; font-size: 17px; }
.subtitle { color: var(--text-2); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.context-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px;
  font-size: 12px;
}
.context-label { color: var(--text-2); }
.context-clear {
  background: none; border: none; color: var(--text-2); cursor: pointer; font-size: 14px; line-height: 1;
}
.context-clear:hover { color: var(--danger); }

.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 18px; min-width: 0; }

/* Buttons */
.btn {
  padding: 7px 12px;
  border-radius: 7px;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-3);
  color: var(--text);
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-2); }
.btn-secondary { background: var(--bg-3); color: var(--text); }
.btn-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-text { background: none; color: var(--accent); padding: 0; }
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 7px;
  border: none;
  background: var(--bg-3);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  display: grid; place-items: center;
}

/* KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.kpi-value { font-size: 22px; font-weight: 800; color: var(--accent); }
.kpi-label { font-size: 11px; color: var(--text-2); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.05em; }
/* Icona di categoria a inizio riga in Prodotti e Macchine. */
.cat-icon {
  width: 18px; height: 18px; object-fit: contain;
  vertical-align: -3px; margin-right: 6px; flex: none;
}
.cat-icon-lg { width: 30px; height: 30px; margin-right: 0; vertical-align: middle; }

/* Allegati del personale: documenti e foto con annotazione. */
.staff-doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.staff-doc-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 8px;
  background: var(--surface); display: flex; flex-direction: column; gap: 6px;
}
.staff-doc-preview {
  display: flex; align-items: center; justify-content: center; height: 100px;
  background: var(--bg-2); border-radius: 8px; overflow: hidden; text-decoration: none;
}
.staff-doc-preview img { width: 100%; height: 100%; object-fit: cover; }
.staff-doc-icon { font-size: 34px; }
.staff-doc-name {
  font-size: 12px; font-weight: 600; color: var(--text); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.staff-doc-name:hover { text-decoration: underline; }
.staff-doc-date { font-size: 11px; color: var(--text-2); }
.staff-doc-note {
  width: 100%; font-size: 12px; padding: 4px 6px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-2); color: var(--text);
}

/* KPI che porta al modulo corrispondente: deve sembrare cliccabile prima del clic. */
.kpi-clickable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.kpi-clickable:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 18px rgba(0, 0, 0, .1); }
.kpi-clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kpi-clickable .kpi-label::after,
.kpi-clickable .card-title::after { content: ' →'; opacity: .55; }
@media (prefers-reduced-motion: reduce) {
  .kpi-clickable { transition: none; }
  .kpi-clickable:hover { transform: none; }
}

/* Sections & cards */
.section { margin-bottom: 24px; }
.section-title { font-size: 16px; margin: 0 0 8px; }
.hint { color: var(--text-2); font-size: 12px; margin: 0 0 14px; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 5px; }
.card-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.card-body { color: var(--text-2); font-size: 12px; line-height: 1.5; margin-bottom: 10px; }
.card-action { color: var(--accent); font-size: 11px; font-weight: 600; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.data-table th, .data-table td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table th { background: var(--bg-3); color: var(--text-2); font-weight: 600; text-transform: uppercase; font-size: 10px; letter-spacing: 0.05em; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.03); }
.data-table td:last-child { white-space: normal; }
.data-table td .btn { margin: 2px 0; }

/* Clienti column widths */
.clients-table th:nth-child(1), .clients-table td:nth-child(1) { width: 36px; }
.clients-table th:nth-child(2), .clients-table td:nth-child(2) { width: 10%; }
.clients-table th:nth-child(3), .clients-table td:nth-child(3) { width: 23%; white-space: normal; }
.clients-table th:nth-child(4), .clients-table td:nth-child(4) { width: 9%; }
.clients-table th:nth-child(5), .clients-table td:nth-child(5) { width: 13%; }
.clients-table th:nth-child(6), .clients-table td:nth-child(6) { width: 11%; }
.clients-table th:nth-child(7), .clients-table td:nth-child(7) { width: 7%; }
.clients-table th:nth-child(8), .clients-table td:nth-child(8) { width: 9%; }
.clients-table th:nth-child(9), .clients-table td:nth-child(9) { width: 18%; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.badge.active, .badge.validated, .badge.completed, .badge.current { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge.pending, .badge.in_progress, .badge.warning, .badge.open { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge.draft, .badge.planning { background: rgba(148, 163, 184, 0.15); color: var(--text-2); }
.badge.expired, .badge.danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge.future { background: rgba(59, 130, 246, 0.15); color: var(--info); }

/* Filters & search */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter, .search {
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  min-width: 140px;
}
.search { flex: 1; min-width: 200px; }

/* Tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* AI Panel */
.ai-panel {
  width: 420px;
  max-width: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 30;
}
.ai-panel[hidden] { display: none !important; }
.ai-header {
  padding: 13px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.ai-title { display: flex; align-items: center; gap: 10px; }
.ai-star { color: var(--accent); font-size: 19px; }
.ai-subtitle { display: block; color: var(--text-2); font-size: 11px; font-weight: 400; }
.ai-controls { display: flex; align-items: center; gap: 7px; }
.ai-backdrop { display: none; }
.context-selector {
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 11px;
  max-width: 160px;
}
.ai-messages { flex: 1; overflow-y: auto; padding: 13px; display: flex; flex-direction: column; gap: 12px; }
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-msg.system { justify-content: center; }
.ai-bubble {
  max-width: 90%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 13px;
}
.ai-msg.assistant .ai-bubble {
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex; gap: 9px;
}
.ai-msg.user .ai-bubble { background: var(--accent); color: var(--bg); }
.ai-msg.system .ai-bubble { background: rgba(59, 130, 246, 0.12); color: var(--info); font-size: 11px; }
.ai-avatar { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: rgba(47,127,216,0.15); color: var(--accent); display: grid; place-items: center; font-size: 12px; }
.ai-sources { margin-top: 7px; font-size: 10px; color: var(--text-2); }
.ai-source { display: inline-block; background: var(--bg-3); padding: 2px 6px; border-radius: 4px; margin-right: 4px; }
.ai-input-area { padding: 12px; border-top: 1px solid var(--border); }
.ai-knowledge { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ai-knowledge-label { font-size: 12px; color: var(--text-2); }
.ai-busy { font-size: 11px; color: var(--accent); margin-bottom: 7px; }
.ai-input-row { display: flex; gap: 7px; }
.ai-input-row input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
}

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%; max-width: 720px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.modal-content-wide { max-width: 980px; }

/* Scheda prodotto: vetro grigio semitrasparente sopra lo sfondo scuro,
   diversa apposta dal modulo di modifica cosi' si riconosce a colpo
   d'occhio che e' un'anteprima e non un form. Le variabili sotto vengono
   lette da regole gia' esistenti (.form-field input, .hint, .icon-btn...)
   che usano var(--text)/var(--border)/var(--bg-2): basta ridefinirle qui
   perche' si adattino da sole, senza duplicare ogni regola. */
.modal-preview {
  --bg-2: rgba(255,255,255,0.08);
  --text: #f4f6f8;
  --text-2: rgba(235,238,242,0.62);
  --border: rgba(255,255,255,0.18);
}
.modal-preview .modal-backdrop {
  background: rgba(12,14,18,0.62);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.modal-preview .modal-content {
  background: rgba(54,58,66,0.88);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  color: var(--text);
}
.modal-preview .modal-header { border-bottom-color: rgba(255,255,255,0.14); }
.modal-preview .btn-secondary { background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.22); }
.modal-preview .btn-secondary:hover { background: rgba(255,255,255,0.22); }
.modal-preview a { color: #9cc6f5; }

.pp-gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-gallery img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; }
.pp-docs { display: flex; flex-direction: column; gap: 6px; }
.pp-doc { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; }
.pp-doc a { font-size: 13px; text-decoration: none; }
.pp-doc a:hover { text-decoration: underline; }
.pp-doc-meta { color: var(--text-2); font-size: 11px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }

.modal-header { padding: 13px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 16px; overflow-y: auto; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.detail-grid label { display: block; font-size: 10px; text-transform: uppercase; color: var(--text-2); margin-bottom: 3px; }
.detail-grid p { margin: 0; font-weight: 600; font-size: 13px; }

.machine-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 16px 0; }
.machine-chart-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; height: 260px; display: flex; flex-direction: column; }
.machine-chart-box canvas { flex: 1; min-height: 0; }
.machine-chart-label { margin-top: 8px; font-size: 13px; color: var(--text); }
.machine-chart-label strong { font-size: 15px; }
.machine-chart-detail { margin-top: 4px; font-size: 11px; color: var(--text-2); }

.photos-preview, .photos-existing, .photos-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photo-thumb { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .photo-remove { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(239, 68, 68, 0.9); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; }

.section-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.section-header .filters { margin: 0; }

/* Products layout: no horizontal scroll, adaptive filters */
.products-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.products-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  width: 100%;
}
.products-filters .filter, .product-search { width: 100%; min-width: 0; }
.products-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  flex-shrink: 0;
}
.products-actions .btn { white-space: nowrap; }

.products-table-wrap { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; overflow-x: auto; }
.products-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.products-table th, .products-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.products-table th { background: var(--bg-3); color: var(--text-2); font-weight: 600; text-transform: uppercase; font-size: 10px; letter-spacing: 0.05em; }
.products-table tr:last-child td { border-bottom: none; }
.products-table tr:hover td { background: rgba(255,255,255,0.03); }
.products-table td:last-child { white-space: normal; }
.products-table td .btn { margin: 2px; }

/* Product column widths — 8 colonne reali: checkbox, Marca, Codice, Nome, Categoria, Listino, Costo forn., Azione */
.products-table th:nth-child(1), .products-table td:nth-child(1) { width: 36px; }
.products-table th:nth-child(3), .products-table td:nth-child(3) { width: 12%; }
.products-table th:nth-child(4), .products-table td:nth-child(4) { width: 12%; }
.products-table th:nth-child(5), .products-table td:nth-child(5) { width: 20%; }
.products-table th:nth-child(6), .products-table td:nth-child(6) { width: 14%; }
.products-table th:nth-child(7), .products-table td:nth-child(7) { width: 10%; }
.products-table th:nth-child(8), .products-table td:nth-child(8) { width: 10%; }
.products-table th:nth-child(9), .products-table td:nth-child(9) { width: 22%; }

@media (max-width: 900px) {
  .products-actions { justify-content: flex-start; max-width: 100%; }
  .products-table th:nth-child(8), .products-table td:nth-child(8) { display: none; }
  .products-table th:nth-child(5), .products-table td:nth-child(5) { width: 25%; }
  .products-table th:nth-child(9), .products-table td:nth-child(9) { width: 27%; }
}
@media (max-width: 700px) {
  .products-table th:nth-child(6), .products-table td:nth-child(6) { display: none; }
  .products-table th:nth-child(3), .products-table td:nth-child(3) { width: 12%; }
  .products-table th:nth-child(4), .products-table td:nth-child(4) { width: 12%; }
  .products-table th:nth-child(5), .products-table td:nth-child(5) { width: 35%; }
  .products-table th:nth-child(7), .products-table td:nth-child(7) { width: 10%; }
  .products-table th:nth-child(9), .products-table td:nth-child(9) { width: 31%; }
}
@media (max-width: 520px) {
  .products-filters { grid-template-columns: 1fr; }
  .products-table th:nth-child(7), .products-table td:nth-child(7) { display: none; }
  .products-table th:nth-child(3), .products-table td:nth-child(3) { width: 14%; }
  .products-table th:nth-child(4), .products-table td:nth-child(4) { width: 14%; }
  .products-table th:nth-child(5), .products-table td:nth-child(5) { width: 45%; }
  .products-table th:nth-child(9), .products-table td:nth-child(9) { width: 27%; }
  .products-table td:last-child .btn { display: block; width: 100%; margin: 2px 0; }
}

.form-field { margin-bottom: 10px; }
.form-field label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-2); margin-bottom: 4px; }
.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
}
/* Una casella o un pallino non devono allungarsi al 100% ne' prendere il
   padding di un campo di testo: e' la stessa regola qui sopra a incastrare
   ogni checkbox dentro .form-field, riquadri "Moduli abilitati" e
   "Cataloghi visibili" compresi, spingendo il testo lontano dalla spunta. */
.form-field input[type="checkbox"],
.form-field input[type="radio"] {
  width: auto;
  height: auto;
  padding: 0;
  flex: none;
  margin: 0;
}
/* Dentro questi due riquadri l'etichetta e' scritta a mano nel form (non
   e' il titolo della sezione), quindi non deve ereditare lo stile pensato
   per i titoli dei campi (maiuscolo, piccolo, grigio). */
.form-field label[style*="display:flex"],
.form-field label[style*="display: flex"] {
  text-transform: none;
  font-size: 13px;
  color: var(--text);
}
.input-with-voice { display: flex; gap: 8px; align-items: stretch; }
.input-with-voice input,
.input-with-voice textarea { flex: 1; }
.input-with-voice .voice-btn { flex-shrink: 0; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; font-size: 16px; cursor: pointer; }
.input-with-voice .voice-btn:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.voice-btn.recording { background: var(--danger) !important; color: var(--bg) !important; border-color: var(--danger) !important; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.quote-item-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px;
}
.quote-item-info { flex: 1; min-width: 0; }
.quote-item-qtyprice { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.quote-item-qtyprice input.filter {
  padding: 4px 6px; font-size: 12px; min-width: 0;
}
.quote-item-qtyprice .q-item-qty { flex: 0 0 44px; }
.quote-item-qtyprice .q-item-price { flex: 0 0 70px; }
.quote-item-qtyprice .remove-item { flex-shrink: 0; padding: 2px 8px; }

.quote-product-search { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.quote-product-search .filter { flex: 1 1 140px; min-width: 0; padding: 6px 10px; font-size: 13px; }

.quote-search-results {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 280px; overflow-y: auto; margin-bottom: 10px; padding: 2px;
}
.quote-result-card {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  transition: border-color .3s, background-color .3s;
}
.quote-result-card.added { border-color: var(--success); background: rgba(34, 197, 94, 0.06); }
.quote-result-card.just-added { animation: quote-result-flash 0.7s ease; }
@keyframes quote-result-flash {
  0% { background-color: rgba(34, 197, 94, 0.28); }
  100% { background-color: rgba(34, 197, 94, 0.06); }
}
.quote-result-main { flex: 1; min-width: 0; }
.quote-result-title { font-size: 12px; }
.quote-result-meta { font-size: 11px; margin-top: 1px; }
.quote-result-desc { font-size: 11px; color: var(--text-2); margin-top: 2px; white-space: normal; line-height: 1.3; }
.quote-result-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.quote-result-price { font-weight: 600; font-size: 12px; white-space: nowrap; }
.quote-result-side .btn-sm { padding: 4px 10px; font-size: 11px; }

/* Azioni tabella */
.data-table td:has(> .btn):not(:last-child) { white-space: nowrap; }
.data-table td .btn { margin: 2px; }
/* Cella Azione dei preventivi: Cliente + Modifica non ci stanno in 153px fissi;
   senza questa riga Modifica viene tagliata via dall'ellipsis e sembra sparita. */
.data-table td:has(> .quote-edit):not(:last-child) { white-space: normal; }

/* Input file */
input[type="file"] {
  flex: 1;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 12px;
}
.ocr-block .hint { color: var(--text-2); font-size: 11px; }

/* Tech calendar */
.tech-calendar { margin-top: 10px; }
.tech-cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 7px;
}
.tech-cal-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tech-cal-date {
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
}
.tech-cal-weekday {
  font-weight: 500;
  font-size: 10px;
  color: var(--text-2);
  text-transform: uppercase;
  margin-left: 4px;
}
.tech-cal-day .filter,
.tech-cal-day input {
  min-width: auto !important;
  width: 100%;
  padding: 3px 5px !important;
  font-size: 11px;
}
.tech-cal-day.att-present {
  background: rgba(34, 197, 94, 0.12);
  border-color: var(--success);
}
.tech-cal-day.att-leave {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--danger);
}
.tech-cal-day.att-sick {
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--warning);
}

/* Knowledge Graph */
.kg-result { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.kg-node { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px; }
.kg-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.kg-type { font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); border: 1px solid var(--accent); padding: 2px 6px; border-radius: 4px; }
.kg-relations { display: flex; flex-direction: column; gap: 7px; }
.kg-relation { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.kg-rel-label { color: var(--text-2); min-width: 84px; }
.kg-empty { color: var(--text-2); font-size: 11px; }

/* Utility */
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.mobile-only { display: none; }

/* Charts */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.chart-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.chart-card h3 {
  margin: 0 0 13px;
  font-size: 13px;
  color: var(--text);
}
.chart-body {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.pie-chart {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  color: var(--text-2);
}
.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
}
.pie-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Login view */
.login-view {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, rgba(47,127,216,0.08), transparent 40%), var(--bg);
}
body:has(.login-view:not([hidden])) {
  overflow: hidden;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.login-logo {
  display: block;
  max-width: 190px;
  width: 100%;
  height: auto;
  margin: 0 auto 16px;
}
.login-view label {
  display: block;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-2); margin: 13px 0 5px;
}
.login-view input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
}
.form-message { margin-top: 10px; font-size: 12px; }
.form-message.error { color: var(--danger); }
.form-message.info { color: var(--info); }

/* Tech Chrome Light Theme overrides */
.sidebar {
  background: linear-gradient(180deg, #fdfefe, #eef2f5);
  border-right: 1px solid #dbe2e8;
}
.sidebar-header { border-bottom: 1px solid var(--border); }
.sidebar-footer { border-top: 1px solid var(--border); }
.sidebar .brand-text { color: var(--text); }
.sidebar .brand-text span { color: var(--accent); }
.nav-item { color: var(--text-2); }
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: #e8f1fb; color: #2f6fae; }
.nav-group-toggle { color: var(--text-2); }
.nav-group-toggle:hover { background: var(--bg-3); color: var(--text); }
.nav-group-toggle.expanded { color: var(--accent); }
.ai-shortcut { border: 1px solid var(--accent); background: rgba(47, 127, 216, 0.08); color: var(--accent); }
.ai-shortcut:hover { background: rgba(47, 127, 216, 0.16); }
.ai-star, .ai-avatar { color: var(--accent); }
.ai-avatar { background: rgba(47, 127, 216, 0.12); }

.topbar { background: #fdfefe; border-bottom: 1px solid var(--border); }
.main { background: var(--bg); }

.btn-primary {
  background: linear-gradient(180deg, #7ab1e8, #2f7fd8 52%, #266ab4);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 6px 14px rgba(47,127,216,.2);
}
.btn-primary:hover { background: linear-gradient(180deg, #8dbdec, #3a8ce3 52%, #2c78c9); }
.btn-secondary { background: linear-gradient(180deg, #ffffff, #f2f5f8); color: var(--text); border: 1px solid var(--border); }
.icon-btn { background: var(--bg-2); color: var(--text); border: 1px solid var(--border); }

.kpi, .card, .modal-content, .login-card, .ai-panel {
  background: linear-gradient(180deg, #ffffff, #f8fafb);
  border: 1px solid #dfe6ec;
  box-shadow: var(--shadow);
}
.kpi-value { color: var(--accent); }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-label { color: var(--accent); }
.card-action { color: var(--accent); }

.data-table th { background: var(--bg-2); color: var(--text-2); }
.data-table tr:hover td { background: rgba(47, 127, 216, 0.05); }
.products-table th { background: var(--bg-2); color: var(--text-2); }
.products-table tr:hover td { background: rgba(47, 127, 216, 0.05); }

/* Righe cliccabili nelle tabelle */
tr.row-clickable { cursor: pointer; }
tr.row-clickable:hover td { background: rgba(47, 127, 216, 0.10); }

.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.context-badge { background: rgba(47, 127, 216, 0.08); border: 1px solid rgba(47, 127, 216, 0.25); }

.login-view {
  background: radial-gradient(circle at 30% 20%, rgba(47,127,216,0.08), transparent 40%), var(--bg);
}

/* Page loader */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(243, 244, 246, 0.88);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-loader[hidden] { display: none !important; }
.page-loader-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 32px;
  box-shadow: var(--shadow);
  text-align: center;
  min-width: 260px;
}
.page-loader-bar-wrap {
  width: 100%;
  height: 12px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}
.page-loader-bar {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    #2f7fd8,
    #2f7fd8 14px,
    #266ab4 14px,
    #266ab4 28px
  );
  background-size: 200% 100%;
  animation: loader-stripes 0.9s linear infinite;
}
.page-loader-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
@keyframes loader-stripes {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* Responsive */
@media (max-width: 900px) {
  .mobile-only { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .2s;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 15;
  }
  .ai-panel {
    position: fixed; right: 0; top: 0; bottom: 0; width: 100%;
  }
  .ai-panel[hidden] { display: none !important; }
  .ai-panel:not([hidden]) { display: flex; }
  .ai-backdrop {
    display: block;
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 20;
  }
  .ai-backdrop[hidden] { display: none !important; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .content { padding: 14px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar-title h1 { font-size: 15px; }
  .context-badge { display: none; }
}

/* Tabelle: su schermi stretti forzare uno scroll orizzontale leggibile
   invece di schiacciare ogni colonna nella larghezza dello schermo. */
@media (max-width: 700px) {
  .data-table, .products-table { min-width: 640px; }
}

/* ==========================================================================
   Modulo Progettista e Cantieri
   ========================================================================== */

.tab-group { display: inline-flex; gap: 6px; background: var(--bg-2); padding: 4px; border-radius: 10px; }
.tab-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: 0 2px 6px rgba(49,62,76,0.08); }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-badge.planning { background: #e8f1fb; color: #2f6fae; }
.status-badge.active { background: #dcfce7; color: #166534; }
.status-badge.on_hold { background: #fef3c7; color: #92400e; }
.status-badge.completed { background: #dbeafe; color: #1e40af; }
.status-badge.archived { background: #f3f4f6; color: #6b7280; }
.status-badge.draft { background: #f3f4f6; color: #6b7280; }
.status-badge.to_approve { background: #fef3c7; color: #92400e; }
.status-badge.approved { background: #dcfce7; color: #166534; }
.status-badge.superseded { background: #fee2e2; color: #991b1b; }
.status-badge.todo { background: #f3f4f6; color: #6b7280; }
.status-badge.in_progress { background: #e0f2fe; color: #075985; }
.status-badge.done { background: #dbeafe; color: #1e40af; }
.status-badge.verified { background: #dcfce7; color: #166534; }
.status-badge.blocked { background: #fee2e2; color: #991b1b; }
.status-badge.pending { background: #fef3c7; color: #92400e; }
.status-badge.viewer,
.status-badge.collaborator,
.status-badge.coordinator,
.status-badge.owner { background: #e8f1fb; color: #2f6fae; }

.site-card:hover { transform: translateY(-2px); }
.task-row.selected { background: rgba(47,127,216,0.08); }
.task-row:hover { background: rgba(47,127,216,0.04); }

.panel h3 { margin-top: 0; }

@media (max-width: 900px) {
  .site-card { grid-column: 1 / -1 !important; }
}

/* ==========================================================================
   Centro attività / Notifiche
   ========================================================================== */

.user-name-display {
  display: inline-flex;
  align-items: center;
  max-width: 160px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 680px) {
  .user-name-display {
    display: none;
  }
}

.notifications-toggle {
  position: relative;
  padding: 4px 6px;
  line-height: 1;
  color: #475569;
  overflow: visible;
}

.notifications-toggle .bell-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.notifications-toggle.active {
  background: rgba(47, 127, 232, 0.12);
  color: #1358c4;
}

/* Stato allarme con notifiche non lette */
.notifications-toggle.has-unread {
  color: #ef3838;
}

.notifications-toggle.has-unread .bell-icon {
  animation: bell-shake 1.1s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(239, 56, 56, 0.6));
}

.notifications-toggle.has-unread::before,
.notifications-toggle.has-unread::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 2px solid rgba(239, 56, 56, 0.75);
  opacity: 0;
  pointer-events: none;
  animation: alarm-rays 1.6s ease-out infinite;
}

.notifications-toggle.has-unread::after {
  animation-delay: 0.8s;
}

@keyframes bell-shake {
  0%, 100% { transform: rotate(0); }
  12% { transform: rotate(14deg); }
  24% { transform: rotate(-14deg); }
  36% { transform: rotate(10deg); }
  48% { transform: rotate(-10deg); }
  60% { transform: rotate(6deg); }
  72% { transform: rotate(-6deg); }
  84% { transform: rotate(2deg); }
}

@keyframes alarm-rays {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(2.8); opacity: 0; }
}

.notifications-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: #ef3838;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.notifications-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 1100;
}

.notifications-backdrop[hidden] { display: none !important; }

.notifications-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100%;
  height: 100vh;
  background: #fff;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.18);
  z-index: 1110;
  display: flex;
  flex-direction: column;
}

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

.notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.notifications-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notifications-title strong {
  font-size: 16px;
  color: var(--text);
}

.notifications-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.notifications-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notifications-filters {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.notifications-filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.notifications-tab {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.notifications-tab.active,
.notifications-tab:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.notifications-site-filter {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}

.notifications-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  background: #f4f5f7;
}

.notifications-group {
  margin-bottom: 12px;
}

.notifications-group-label {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #eef1f4;
  cursor: pointer;
  transition: background 0.12s ease;
}

.notification-item:hover,
.notification-item:focus {
  background: #f8fafc;
  outline: none;
}

.notification-item.unread {
  background: #f0f7ff;
}

.notification-item.unread .notification-title {
  font-weight: 700;
}

.notification-icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef1f4;
  font-size: 18px;
}

.notification-body {
  flex: 1;
  min-width: 0;
}

.notification-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}

.notification-actor {
  font-weight: 700;
  color: var(--text);
}

.notification-site {
  background: #eef1f4;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.notification-time {
  margin-left: auto;
  font-size: 10px;
}

.notification-title {
  font-size: 13px;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 2px;
}

.notification-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: break-word;
}

.notification-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.notification-indicators {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: none;
}

.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f7fe8;
}

.notification-read-btn,
.notification-archive-btn {
  font-size: 12px;
  padding: 4px;
  opacity: 0.6;
}

.notification-read-btn:hover,
.notification-archive-btn:hover {
  opacity: 1;
}

.notifications-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.notifications-load-more {
  padding: 12px 16px;
  text-align: center;
}

@media (max-width: 600px) {
  .notifications-panel {
    width: 100%;
    border-radius: 0;
  }

  .notifications-filter-tabs {
    gap: 4px;
  }

  .notifications-tab {
    padding: 5px 10px;
    font-size: 11px;
  }

  .notification-item {
    padding: 10px 12px;
  }

  .notification-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .notifications-panel {
    width: 360px;
  }
}

@media (min-width: 901px) {
  .notifications-panel {
    width: 420px;
  }
}

/* Product catalogue: approved 80px images and theme-aligned action controls. */
.products-table th:nth-child(2), .products-table td:nth-child(2) { width:100px; }
.products-table td { padding-top:14px; padding-bottom:14px; vertical-align:middle; }
.products-table .product-list-image { width:80px;height:80px;object-fit:contain;display:block;border-radius:12px;background:#fff; }
.products-table .product-name-cell { white-space:normal;line-height:1.45;overflow-wrap:anywhere; }
.products-table .product-actions-cell .btn { min-height:36px;padding:8px 11px;border:1px solid rgba(255,255,255,.95);border-radius:11px;background:linear-gradient(145deg,#fafcfe,#e4eaf1);color:#4f626f;font-weight:500;box-shadow:4px 4px 9px #d0d8e1,-3px -3px 8px #fff; }
.products-table .product-actions-cell .btn:hover { background:linear-gradient(145deg,#f2f6e9,#dfe9cb);color:#536638; }
.products-table .product-actions-cell .btn:focus-visible { outline:2px solid #789347;outline-offset:2px; }
.products-table .product-actions-cell .btn:active { box-shadow:inset 2px 2px 5px #cbd3db,inset -2px -2px 5px #fff; }
.products-table .product-actions-cell .btn-danger { color:#a94453; }
.products-table .product-actions-cell .product-attachments { color:#718a4d; }
.products-table-wrap { overflow-x:auto; }
@media(max-width:700px){.products-table{min-width:690px;}}
