/* GENERATED FROM SPEC — DO NOT EDIT DIRECTLY */
/* Source: openspec/specs/product-catalog/spec.md */

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-hero {
  background: linear-gradient(145deg, var(--lp-primary-900) 0%, var(--lp-primary-700) 60%, #0c4a6e 100%);
  color: var(--lp-text-inverse);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-hero .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-hero .brand-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--lp-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-hero .brand h1 {
  font-size: 1.5rem;
}

.login-hero .brand span {
  font-size: 0.8125rem;
  opacity: 0.7;
  display: block;
  font-weight: 400;
}

.login-hero-content h2 {
  font-size: 2.25rem;
  margin-bottom: 16px;
  max-width: 400px;
}

.login-hero-content p {
  opacity: 0.8;
  max-width: 380px;
  line-height: 1.7;
}

.login-hero-stats {
  display: flex;
  gap: 32px;
}

.login-hero-stats div strong {
  display: block;
  font-size: 1.5rem;
}

.login-hero-stats div span {
  font-size: 0.8125rem;
  opacity: 0.65;
}

.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--lp-surface-muted);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
}

.login-card h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.login-card .subtitle {
  color: var(--lp-text-muted);
  font-size: 0.9375rem;
  margin-bottom: 32px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-error {
  padding: 12px 14px;
  background: #fef2f2;
  color: #991b1b;
  border-radius: var(--lp-radius-md);
  font-size: 0.875rem;
  border: 1px solid #fecaca;
}

.login-demo {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--lp-border);
  font-size: 0.8125rem;
  color: var(--lp-text-muted);
}

.login-demo code {
  background: var(--lp-surface-muted);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
}

body[data-theme="scuro"] {
  --lp-primary-900: #020617;
  --lp-primary-800: #0f172a;
  --lp-primary-700: #1e293b;
  --lp-primary-600: #2563eb;
  --lp-primary-500: #3b82f6;
  --lp-primary-100: rgba(59, 130, 246, 0.16);
  --lp-surface: #0f172a;
  --lp-surface-muted: #020617;
  --lp-border: #1e293b;
  --lp-text: #e2e8f0;
  --lp-text-muted: #94a3b8;
  --lp-text-inverse: #f8fafc;
}

body[data-density="compatta"] .btn {
  padding: 8px 14px;
}

body[data-density="compatta"] .input-field {
  padding: 9px 12px;
}

/* App shell */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--lp-sidebar-width);
  background: var(--lp-primary-900);
  color: var(--lp-text-inverse);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--lp-primary-600);
  border-radius: var(--lp-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand .title {
  font-weight: 700;
  font-size: 1rem;
}

.sidebar-brand .subtitle {
  font-size: 0.6875rem;
  opacity: 0.55;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--lp-radius-md);
  color: rgba(248, 250, 252, 0.7);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 4px;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active {
  background: var(--lp-primary-600);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--lp-primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-info .name {
  font-size: 0.875rem;
  font-weight: 600;
}

.user-info .role {
  font-size: 0.75rem;
  opacity: 0.55;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}

.topbar {
  background: var(--lp-surface);
  border-bottom: 1px solid var(--lp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.topbar h1 {
  font-size: 1.25rem;
}

.topbar-shell {
  min-height: var(--lp-header-height);
  gap: 16px;
  flex-wrap: nowrap;
  padding-top: 10px;
  padding-bottom: 10px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(135deg, var(--lp-primary-900) 0%, var(--lp-primary-800) 58%, var(--lp-primary-700) 100%);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.topbar-shell-left,
.topbar-shell-right {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.topbar-shell-left {
  flex: 1;
  flex-wrap: nowrap;
}

.topbar-shell-right {
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 10px;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.topbar-brand .brand-icon {
  width: 38px;
  height: 38px;
  background: var(--lp-primary-600);
  color: var(--lp-text-inverse);
  border-radius: var(--lp-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.topbar-brand .brand-icon.has-logo {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.store-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topbar-brand .title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--lp-text-inverse);
}

.topbar-brand .subtitle {
  font-size: 0.6875rem;
  color: rgba(248, 250, 252, 0.7);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.topbar-nav .nav-item {
  margin-bottom: 0;
  color: rgba(248, 250, 252, 0.72);
  background: transparent;
  border: 1px solid transparent;
}

.topbar-nav .nav-item:hover,
.topbar-nav .nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--lp-text-inverse);
}

.topbar-nav .nav-item.active {
  background: rgba(59, 130, 246, 0.28);
  color: white;
  border-color: rgba(191, 219, 254, 0.32);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 0;
  margin-bottom: 1rem;
}

.page-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  color: var(--lp-text-muted);
}

.page-content-tight {
  padding-top: 18px;
}

.page-content-tight .pagination-bar {
  margin: 0.2rem 0;
  padding: 0.2rem 0.1rem;
}

.page-content-tight .pagination-bar .btn-sm {
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  min-height: 26px;
}

.topbar-shell .user-info .name {
  color: var(--lp-text-inverse);
}

.topbar-shell .user-info .role {
  color: rgba(248, 250, 252, 0.65);
}

.topbar-shell .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--lp-text-inverse);
  border-color: rgba(255, 255, 255, 0.16);
}

.topbar-shell .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.movimenti-toolbar-actions {
  margin-bottom: 0.25rem;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: var(--lp-radius-md);
  border: 1px solid var(--lp-border);
  background: var(--lp-surface-muted, #f8fafc);
  color: var(--lp-text-muted);
}

.sync-status .material-symbols-outlined {
  font-size: 16px;
}

.sync-status--online {
  color: #15803d;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.sync-status--offline {
  color: #b45309;
  border-color: #fde68a;
  background: #fffbeb;
}

.sync-status--pending {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.page-content {
  padding: 28px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* Articoli — stesso layout di movimenti */
.articoli-page {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  min-height: 0;
}

.articoli-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.articoli-top-strip {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
  min-width: 0;
}

.articoli-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.articoli-kpi-grid {
  flex: 1;
  min-width: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0;
}

.stat-card-compact {
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem;
}

.stat-card-compact .stat-icon {
  margin-bottom: 0;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--lp-radius-sm);
}

.stat-card-compact .stat-icon .material-symbols-outlined {
  font-size: 16px;
}

.stat-card-compact .stat-body {
  min-width: 0;
  flex: 1;
}

.stat-card-compact .stat-label {
  font-size: 0.625rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card-compact .stat-value {
  font-size: 1rem;
  line-height: 1.1;
}

.stat-card-compact .stat-value-action {
  font-size: 1.1rem;
  line-height: 1;
}

.stat-card-compact .stat-action-hint {
  display: none;
}

.articoli-kpi-grid .stat-card-compact {
  padding: 0.5rem 0.65rem;
  gap: 0.5rem;
  min-height: 3.1rem;
}

.articoli-kpi-grid .stat-card-compact .stat-icon {
  width: 32px;
  height: 32px;
}

.articoli-kpi-grid .stat-card-compact .stat-icon .material-symbols-outlined {
  font-size: 18px;
}

.articoli-kpi-grid .stat-card-compact .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.articoli-kpi-grid .stat-card-compact .stat-value {
  font-size: 1.35rem;
  line-height: 1.15;
}

.articoli-kpi-grid .stat-card-compact .stat-value-action {
  font-size: 1.45rem;
}

.articoli-kpi-grid .stat-card-action:hover,
.articoli-kpi-grid .stat-card-action:focus-visible {
  transform: none;
}

.articoli-data-panel {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.35rem 0.3rem;
  border: 1px solid var(--lp-border, #e2e8f0);
  border-radius: var(--lp-radius-md);
  background: #f8fafc;
  align-self: stretch;
}

.articoli-data-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 3.5rem;
  flex: 1;
  min-height: 0;
  padding: 0.25rem 0.15rem;
  border: 1px solid transparent;
  border-radius: var(--lp-radius-sm);
  background: transparent;
  color: var(--lp-text-muted);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.articoli-data-btn .material-symbols-outlined {
  font-size: 17px;
  color: var(--lp-primary-600);
}

.articoli-data-btn-label {
  font-size: 0.5625rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
}

.articoli-data-btn:hover,
.articoli-data-btn:focus-visible {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--lp-text);
  outline: none;
}

.articoli-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 0.15rem;
}

.articoli-sticky-controls {
  position: sticky;
  top: calc(var(--lp-header-height) + 8px);
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.35rem;
  padding: 0.35rem 0 0.25rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.articoli-sticky-controls::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: rgba(226, 232, 240, 0.9);
}

.articoli-toolbar-actions .toolbar-left {
  flex-wrap: wrap;
}

.articoli-utility-row {
  margin-top: 0.1rem;
  margin-bottom: 0.35rem;
}

.articoli-utility-row .toolbar-left {
  gap: 8px;
}

.articoli-utility-row .btn {
  white-space: nowrap;
}

.articoli-toolbar-actions .btn {
  white-space: nowrap;
}

.articoli-search {
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}

.articoli-toolbar-meta {
  font-size: 0.8125rem;
  color: var(--lp-text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.bulk-actions-count {
  font-size: 0.75rem;
  color: var(--lp-text-muted);
  min-width: 0;
}

.bulk-actions-count:not(:empty) {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--lp-surface-muted);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.35rem 0;
  padding: 0.35rem 0.15rem;
}

.pagination-bar-sticky {
  margin: 0;
  padding: 0.1rem 0.15rem 0;
}

.pagination-bar-pages {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.pagination-bar-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--lp-text-muted);
}

.pagination-size {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--lp-text-muted);
}

.pagination-size select {
  min-width: 4.5rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--lp-border);
  border-radius: 6px;
  background: #fff;
  font-size: 0.8125rem;
}

.pagination-ellipsis {
  padding: 0 0.2rem;
  color: var(--lp-text-muted);
}

.col-select {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  text-align: center;
  padding-left: 6px !important;
  padding-right: 4px !important;
}

.col-select input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--lp-primary-600);
}

.articolo-row.is-selected,
.mov-row.is-selected {
  background: rgba(59, 130, 246, 0.1) !important;
}

.movimenti-toolbar-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.articoli-table-wrap {
  flex: 1;
  min-height: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
}

.articoli-table-compact {
  font-size: 0.75rem;
  width: 100%;
  table-layout: fixed;
}

.articoli-table-compact th {
  padding: 4px 6px;
  font-size: 0.625rem;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  z-index: 2;
}

.articoli-table-compact td {
  padding: 2px 6px;
  line-height: 1.15;
  vertical-align: middle;
}

.articoli-table-compact .cell-clip {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.articoli-table-compact .cell-prodotto {
  max-width: 240px;
}

.articoli-table-compact.table-col-resizable .cell-clip,
.articoli-table-compact.table-col-resizable .cell-prodotto {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.articoli-table-compact th[data-col="categoria"],
.articoli-table-compact td:nth-child(2) {
  width: 108px;
}

.articoli-table-compact th[data-col="codice"],
.articoli-table-compact td:nth-child(3) {
  width: 92px;
}

.articoli-table-compact th[data-col="descrizione"],
.articoli-table-compact td:nth-child(4) {
  width: auto;
}

.articoli-table-compact th[data-col="prezzo"],
.articoli-table-compact td:nth-child(5) {
  width: 68px;
}

.articoli-table-compact th[data-col="produttore"],
.articoli-table-compact td:nth-child(6) {
  width: 84px;
}

.articoli-table-compact th[data-col="giacenza"],
.articoli-table-compact td:nth-child(7) {
  width: 58px;
}

.articoli-table-compact .col-select {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  padding-left: 4px !important;
  padding-right: 2px !important;
}

.articoli-table-compact .col-select input[type="checkbox"] {
  width: 13px;
  height: 13px;
}

.articoli-table-compact .col-actions {
  width: 52px;
  min-width: 52px;
  padding-right: 2px;
}

.articoli-table-compact .btn-icon {
  padding: 2px;
}

.articoli-table-compact td.col-actions,
.articoli-table-compact th.col-actions {
  white-space: nowrap;
}

.articoli-table-compact td.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-width: 52px;
}

.articoli-table-compact .sku {
  font-size: 0.75rem;
}

.articoli-table-compact .btn-icon .material-symbols-outlined {
  font-size: 14px;
}

.articoli-table-compact tbody tr.articolo-row:nth-child(even) {
  background: rgba(248, 250, 252, 0.7);
}

.articoli-table-compact .produttore-group-header td {
  padding: 2px 6px;
  font-size: 0.6875rem;
  line-height: 1.2;
}

.articoli-table-compact .num {
  white-space: nowrap;
}

.articoli-table-compact tbody tr:hover {
  background: rgba(241, 245, 249, 0.95);
}

.produttore-group-header td {
  font-size: 0.75rem;
  padding: 3px 6px;
}

.mov-filter-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: #1e40af;
  cursor: pointer;
  padding: 4px 6px;
}

.mov-filter-manage-btn {
  width: 100%;
  justify-content: center;
}

.articolo-combobox {
  position: relative;
}

.articolo-combobox-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #c5d4ea;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  z-index: 20;
}

.articolo-combobox-item {
  padding: 5px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  line-height: 1.3;
  color: #0f172a;
}

.articolo-combobox-item:hover,
.articolo-combobox-item.active {
  background: #eef3fb;
}

.articolo-combobox-item mark {
  background: #fef08a;
  color: inherit;
  padding: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 360px;
  min-width: 0;
}

.search-box input {
  padding-left: 42px;
}

.search-box .material-symbols-outlined {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--lp-text-muted);
  font-size: 18px;
  pointer-events: none;
  z-index: 1;
}

.filter-select {
  padding: 10px 14px;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  background: var(--lp-surface);
  color: var(--lp-text);
  min-width: 160px;
}

.table-container {
  overflow-x: auto;
  max-width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--lp-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--lp-border);
  background: var(--lp-surface-muted);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--lp-border);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--lp-surface-muted);
}

.data-table .sku {
  font-family: monospace;
  font-size: 0.8125rem;
  color: var(--lp-primary-600);
  font-weight: 600;
}

.data-table .actions {
  display: flex;
  gap: 4px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--lp-text-muted);
}

.empty-state .material-symbols-outlined {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

@media (max-width: 960px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-hero {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .articoli-top-strip {
    flex-direction: column;
  }

  .articoli-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .articoli-data-panel {
    flex-direction: row;
    justify-content: flex-end;
    align-self: flex-end;
  }

  .articoli-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }

  .articoli-page {
    flex-direction: column;
  }

  .articoli-filters-panel {
    width: 100%;
    position: static;
  }

  .movimenti-page {
    flex-direction: column;
  }

  .movimenti-filters-panel {
    width: 100%;
    position: static;
  }

  .topbar,
  .page-content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar-shell {
    align-items: flex-start;
  }

  .topbar-shell-left,
  .topbar-shell-right,
  .topbar-user {
    width: 100%;
  }

  .topbar-shell-right {
    justify-content: space-between;
  }

  .topbar-nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .topbar-nav .nav-item {
    flex: 0 0 auto;
  }

  .page-header {
    padding-left: 18px;
    padding-right: 18px;
    margin-bottom: 0.75rem;
  }

  .articoli-toolbar-actions .toolbar-left,
  .articoli-toolbar .toolbar-left {
    width: 100%;
  }

  .articoli-sticky-controls {
    top: calc(var(--lp-header-height) + 6px);
  }
}

@media (max-width: 640px) {
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .page-content {
    padding: 16px 14px;
  }

  .page-header {
    padding: 16px 14px 0;
  }

  .page-content-tight {
    padding-top: 12px;
  }

  .topbar-brand .subtitle,
  .user-info .role,
  .page-subtitle {
    display: none;
  }

  .topbar-user {
    justify-content: space-between;
    width: 100%;
  }

  .sync-status {
    order: 2;
  }

  .articoli-toolbar-actions .btn,
  .articoli-toolbar .toolbar-left > * {
    width: 100%;
  }

  .filter-toggle {
    width: 100%;
  }

  .filter-toggle-btn {
    flex: 1;
  }

  .filter-select,
  .articoli-search,
  .toolbar-check-label,
  .col-picker-wrap,
  .toolbar-manage-btn {
    width: 100%;
    max-width: none;
  }

  .articoli-sticky-controls {
    position: static;
    padding-top: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .articoli-sticky-controls::after {
    display: none;
  }
}

/* Movimenti — layout compatto stile Danea */
.movimenti-page {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  min-height: 0;
}

.movimenti-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.movimenti-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.movimenti-search {
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}

.movimenti-search .input-field,
.input-compact {
  padding: 6px 10px;
  font-size: 0.8125rem;
  min-height: 32px;
}

.movimenti-search .input-field {
  padding-left: 2.5rem;
}

.movimenti-toolbar-meta {
  font-size: 0.8125rem;
  color: var(--lp-text-muted);
  white-space: nowrap;
}

.movimenti-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.movimenti-filters-panel {
  width: 188px;
  flex-shrink: 0;
  padding: 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #eef3fb;
  border-color: #c5d4ea;
  align-self: flex-start;
  position: sticky;
  top: 0;
}

.mov-filter-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mov-filter-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1e3a5f;
  margin: 0;
}

.mov-filter-mini-label {
  font-size: 0.7rem;
  color: var(--lp-text-muted);
  margin-top: 0.15rem;
}

.mov-filter-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mov-filter-link {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.8125rem;
  color: #1e40af;
  cursor: pointer;
  line-height: 1.25;
}

.mov-filter-link:hover {
  background: rgba(255, 255, 255, 0.55);
}

.mov-filter-link.active {
  background: #fff;
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 0 0 1px #c5d4ea;
}

.mov-filter-custom {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.mov-filter-reset {
  margin-top: 0.25rem;
  border: none;
  background: transparent;
  color: #1e40af;
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.movimenti-table-compact {
  font-size: 0.8125rem;
}

.movimenti-table-compact th {
  padding: 6px 8px;
  font-size: 0.6875rem;
  position: sticky;
  top: 0;
  z-index: 2;
}

.movimenti-table-compact td {
  padding: 3px 8px;
  line-height: 1.25;
  vertical-align: middle;
}

.movimenti-table-compact .col-data {
  white-space: nowrap;
  width: 84px;
  color: var(--lp-text-muted);
}

.movimenti-table-compact .cell-prodotto {
  max-width: 280px;
}

.table-col-resizable .cell-prodotto,
.table-col-resizable .cell-clip {
  max-width: none;
}

/* Colonne ridimensionabili + ordinamento header */
.table-col-resizable {
  table-layout: fixed;
  width: 100%;
}

.table-col-resizable thead th {
  position: relative;
  overflow: hidden;
  padding-right: 10px;
}

.table-col-resizable .th-label {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 12px);
  vertical-align: middle;
}

.col-resize-handle {
  position: absolute;
  top: 0;
  right: -2px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  z-index: 3;
}

.col-resize-handle:hover,
body.col-resizing .col-resize-handle {
  background: rgba(37, 99, 235, 0.22);
}

.table-col-resizable thead th:hover .col-resize-handle {
  background: rgba(148, 163, 184, 0.18);
}

body.col-resizing {
  cursor: col-resize;
  user-select: none;
}

.th-sortable {
  cursor: pointer;
  user-select: none;
}

.th-sortable:hover {
  background: rgba(255, 255, 255, 0.35);
}

.th-sortable .sort-indicator {
  display: inline-block;
  width: 12px;
  margin-left: 2px;
  font-size: 0.625rem;
  color: var(--lp-primary-600);
  vertical-align: middle;
  opacity: 0.35;
}

.th-sortable.sort-asc .sort-indicator::before {
  content: "▲";
  opacity: 1;
}

.th-sortable.sort-desc .sort-indicator::before {
  content: "▼";
  opacity: 1;
}

.th-sortable.sort-asc .sort-indicator,
.th-sortable.sort-desc .sort-indicator {
  opacity: 1;
}

.col-hidden {
  display: none !important;
}

.col-picker-wrap {
  position: relative;
}

.col-picker-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 280px;
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-md);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 30;
}

.col-picker-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--lp-border);
  margin-bottom: 8px;
}

.col-picker-header strong {
  font-size: 0.875rem;
  color: var(--lp-text);
}

.col-picker-header span,
.col-picker-hint {
  font-size: 0.75rem;
  color: var(--lp-text-muted);
}

.col-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.col-picker-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.col-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 0.8125rem;
  cursor: pointer;
  border-radius: 4px;
}

.col-picker-item:hover {
  background: var(--lp-surface-muted);
}

.col-picker-hint {
  margin-top: 8px;
  padding: 8px 4px 2px;
  border-top: 1px solid var(--lp-border);
}

.classifica-import-table {
  max-height: 360px;
  overflow: auto;
}

.classifica-import-table .classifica-brand-select {
  min-width: 180px;
}

.toolbar-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--lp-text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.movimenti-toolbar-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.articoli-toolbar {
  margin-bottom: 0.5rem;
}

.articoli-toolbar .toolbar-left {
  flex-wrap: wrap;
}

.articoli-sticky-controls .articoli-toolbar {
  margin-bottom: 0;
}

.articoli-sticky-controls .articoli-toolbar .toolbar-left {
  gap: 0.45rem;
}

.articoli-sticky-controls .filter-toggle-btn,
.articoli-sticky-controls .filter-select,
.articoli-sticky-controls .btn-sm {
  min-height: 32px;
}

.articoli-sticky-controls .filter-toggle-btn {
  padding: 6px 12px;
}

.articoli-sticky-controls .filter-select {
  padding-top: 6px;
  padding-bottom: 6px;
}

.articoli-dashboard {
  margin-bottom: 0.75rem;
}

.movimenti-table-compact .cell-clip {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movimenti-table-compact .col-actions {
  width: 64px;
  padding-right: 4px;
}

.movimenti-table-compact .btn-icon {
  padding: 2px;
}

.movimenti-table-compact .btn-icon .material-symbols-outlined {
  font-size: 16px;
}

.movimenti-table-compact tbody tr.mov-row:nth-child(even) {
  background: rgba(248, 250, 252, 0.7);
}

.movimenti-tfoot-row td {
  background: #e8eef7;
  border-top: 2px solid #c5d4ea;
  padding: 6px 8px;
  font-size: 0.8125rem;
  position: sticky;
  bottom: 0;
}

.empty-state.compact {
  padding: 24px 12px;
}

.empty-state.compact .material-symbols-outlined {
  font-size: 32px;
  margin-bottom: 6px;
}

.movimenti-table .num {
  text-align: right;
  white-space: nowrap;
}

.date-group-header td {
  background: var(--lp-surface-muted);
  font-size: 0.875rem;
  padding-top: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: none;
}

.produttore-group-header td {
  background: #e8eef7;
  color: #1e3a5f;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 3px 6px;
  border-top: 1px solid #c5d4ea;
}

.data-table .num {
  text-align: right;
  white-space: nowrap;
}

.import-risultato {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--lp-surface-muted);
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.date-group-footer td {
  background: var(--lp-surface-muted);
  font-size: 0.8125rem;
  border-top: 1px solid var(--lp-border);
  padding-top: 0.35rem;
  padding-bottom: 0.75rem;
}

.modal-wide {
  width: 720px;
  max-width: 96vw;
  min-width: 480px;
  min-height: 360px;
  max-height: 96vh;
}

.modal-resizable {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header-title {
  min-width: 0;
  flex: 1;
}

.modal-subtitle {
  margin: 4px 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--lp-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-resize-handle {
  position: absolute;
  z-index: 20;
}

.modal-resize-handle.resize-n,
.modal-resize-handle.resize-s {
  left: 10px;
  right: 10px;
  height: 8px;
}

.modal-resize-handle.resize-e,
.modal-resize-handle.resize-w {
  top: 10px;
  bottom: 10px;
  width: 8px;
}

.modal-resize-handle.resize-n { top: 0; cursor: n-resize; }
.modal-resize-handle.resize-s { bottom: 0; cursor: s-resize; }
.modal-resize-handle.resize-e { right: 0; cursor: e-resize; }
.modal-resize-handle.resize-w { left: 0; cursor: w-resize; }

.modal-resize-handle.resize-ne,
.modal-resize-handle.resize-nw,
.modal-resize-handle.resize-se,
.modal-resize-handle.resize-sw {
  width: 14px;
  height: 14px;
}

.modal-resize-handle.resize-ne { top: 0; right: 0; cursor: ne-resize; }
.modal-resize-handle.resize-nw { top: 0; left: 0; cursor: nw-resize; }
.modal-resize-handle.resize-se { bottom: 0; right: 0; cursor: se-resize; }
.modal-resize-handle.resize-sw { bottom: 0; left: 0; cursor: sw-resize; }

.modal-overlay.modal-fullscreen .modal-resize-handle {
  display: none;
}

.modal-header {
  cursor: move;
}

.modal-header .btn,
.modal-header .btn-icon,
.modal-header input,
.modal-header select,
.modal-header textarea,
.modal-header a {
  cursor: auto;
}

.modal-resizable form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.modal-resizable .modal-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.griglia-varianti-scroll {
  max-height: 320px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-md);
  -webkit-overflow-scrolling: touch;
}

.griglia-varianti-table {
  margin: 0;
}

.griglia-varianti-table .qty-input {
  margin: 0;
}

.input-with-action {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.input-with-action .input-field {
  flex: 1;
  min-width: 0;
}

.input-with-action .btn-icon-inline {
  flex-shrink: 0;
  padding: 0 12px;
}

.movimento-scan-meta {
  margin-bottom: 1rem;
}

.movimento-scan-meta.compact-grid {
  gap: 8px;
  margin-bottom: 0.35rem;
}

.movimento-scan-meta.compact-grid .input-group {
  gap: 3px;
}

.movimento-scan-meta.compact-grid label,
.movimento-scan-input label {
  font-size: 0.72rem;
}

.movimento-scan-input {
  margin-bottom: 0.35rem;
}

.movimento-scan-input .input-with-action {
  gap: 4px;
}

.movimento-scan-input .input-field,
.movimento-scan-input .btn {
  min-height: 30px;
}

.movimento-dialog .modal-body {
  padding: 12px 14px;
  gap: 6px;
}

.movimento-dialog .modal-header {
  padding: 12px 14px;
}

.movimento-dialog .modal-footer {
  padding: 10px 14px;
}

.movimento-dialog .modal-wide {
  width: min(920px, 96vw);
  max-width: 96vw;
  min-width: 640px;
  min-height: 360px;
  max-height: 92vh;
}

.movimento-dialog .griglia-varianti-scroll {
  max-height: min(60vh, 560px);
}

.movimento-dialog .movimento-scan-table {
  width: 100%;
  table-layout: fixed;
}

.movimento-dialog .griglia-varianti-table th {
  padding: 4px 6px;
  font-size: 0.64rem;
}

.movimento-dialog .griglia-varianti-table td {
  padding: 3px 6px;
  line-height: 1.15;
}

.movimento-scan-table .qty-cell-input {
  width: 54px;
  min-height: 28px;
  text-align: right;
  padding: 2px 6px;
}

.movimento-dialog-title {
  margin: 0 0 0.3rem;
  font-size: 0.82rem;
  color: var(--lp-text-muted);
}

.movimento-scan-table tr.scan-highlight {
  background: #ecfdf5;
}

.movimento-scan-table tr.scan-error {
  background: #fef2f2;
}

.movimento-scan-table th:nth-child(1),
.movimento-scan-table td:nth-child(1) {
  width: 110px;
}

.movimento-scan-table th:nth-child(3),
.movimento-scan-table td:nth-child(3) {
  width: 132px;
}

.movimento-scan-table th:nth-child(4),
.movimento-scan-table td:nth-child(4) {
  width: 68px;
}

.movimento-scan-table th:nth-child(5),
.movimento-scan-table td:nth-child(5) {
  width: 42px;
}

.movimento-scan-table th:nth-child(6),
.movimento-scan-table td:nth-child(6) {
  width: 34px;
}

.movimento-scan-table td.actions {
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}

.movimento-scan-table .sku {
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movimento-scan-table .scan-product-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movimento-scan-table .scan-product-brand {
  display: block;
  margin-top: 1px;
  font-size: 0.72rem;
  line-height: 1.1;
  color: var(--lp-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movimento-scan-table td:nth-child(3),
.movimento-scan-table td:nth-child(5) {
  white-space: nowrap;
}

.movimento-scan-table td:nth-child(2) {
  min-width: 0;
}

.movimento-scan-table td.actions .btn-icon {
  padding: 2px;
}

.movimento-dialog .btn,
.movimento-dialog .input-field {
  font-size: 0.82rem;
}

.movimento-dialog .btn-sm,
.movimento-dialog .btn {
  padding-top: 6px;
  padding-bottom: 6px;
}

.movimento-dialog .modal-footer .btn {
  min-height: 34px;
}

.data-table .btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--lp-radius-sm);
  color: var(--lp-text-muted);
}

.data-table .btn-icon:hover {
  background: var(--lp-surface-muted);
  color: var(--lp-primary-600);
}

.data-table .btn-delete:hover {
  color: #dc2626;
}

/* Articoli — stat card cliccabile e gestione produttori */
.stat-card-action {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  position: relative;
}

.stat-card-action:hover,
.stat-card-action:focus-visible {
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.stat-card-create {
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: linear-gradient(135deg, #fff 0%, #f8fbff 100%);
}

.stat-card-create .stat-value-action {
  font-size: 1.1rem;
  color: var(--lp-primary-600);
}

.stat-value-action {
  font-weight: 700;
}

.btn-icon-disabled,
.btn-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.stat-action-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--lp-primary-600);
  font-weight: 500;
}

.brand-manager-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.brand-manager-table {
  max-height: 420px;
  overflow: auto;
}

.brand-edit-input {
  width: 100%;
  min-width: 0;
}

.brand-row-editing .brand-nome-display {
  display: none;
}

.toolbar-manage-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.cat-manager-summary {
  font-size: 0.875rem;
  color: var(--lp-text-muted);
  background: var(--lp-surface-muted);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-md);
  padding: 0.65rem 0.85rem;
}

.cat-manager-table {
  max-height: 420px;
  overflow-y: auto;
}

.cat-manager-table .categoria-parent-row td {
  background: #f8fafc;
}

.cat-manager-table .categoria-sub-row td {
  background: #fff;
}

.cat-expand-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin-right: 0.35rem;
  color: var(--lp-primary-600);
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
}

.cat-expand-btn .material-symbols-outlined {
  font-size: 20px;
}

.cat-parent-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.95rem;
}

.cat-inline-meta {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: var(--lp-text-muted);
}

.cat-add-sub-row td {
  background: #f1f5f9;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
}

.cat-add-sub-inline {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.cat-add-sub-inline .input-field {
  flex: 1;
  max-width: 320px;
}

.cat-row-editing .input-field {
  display: inline-block;
  width: calc(100% - 1.5rem);
  max-width: 360px;
}

.categoria-sub-row .cat-sub-name {
  color: #0f172a;
}

.cat-manager-table .cat-actions-cell {
  display: flex;
  gap: 0.15rem;
  justify-content: flex-end;
  white-space: nowrap;
}

.cat-manager-table .btn-delete:hover {
  color: var(--lp-accent-red, #dc2626);
}

.cat-tree {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.cat-loading {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--lp-text-muted);
}

.cat-loading-error {
  color: var(--lp-accent-red);
}

.cat-tree-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--lp-text-muted);
}

.cat-tree-empty-hint {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.cat-search-row {
  position: relative;
  margin-bottom: 0.75rem;
}

.cat-search-row .input-field {
  width: 100%;
  padding-left: 2.25rem;
}

.cat-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--lp-text-muted);
  font-size: 20px;
  pointer-events: none;
}

.cat-tree-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.cat-tree-toolbar .input-field {
  flex: 1;
}

.cat-details {
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-md);
  background: var(--lp-surface);
  overflow: hidden;
}

.cat-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  background: var(--lp-surface-muted);
  color: var(--lp-text);
  user-select: none;
}

.cat-summary::-webkit-details-marker {
  display: none;
}

.cat-summary::before {
  content: "▸";
  color: var(--lp-primary-600);
  font-size: 0.85rem;
  width: 1rem;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.cat-details[open] > .cat-summary::before {
  transform: rotate(90deg);
}

.cat-summary-name {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
  color: var(--lp-text);
}

.cat-summary-badge,
.cat-summary-subs {
  font-size: 0.75rem;
  color: var(--lp-text-muted);
  background: var(--lp-surface);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--lp-border);
  white-space: nowrap;
}

.cat-edit-btn {
  flex-shrink: 0;
}

.cat-details-body {
  border-top: 1px solid var(--lp-border);
}

.cat-group-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.cat-group-edit .input-field {
  flex: 1;
}

.cat-sub-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
}

.cat-sub-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem 0.45rem 1.75rem;
  color: var(--lp-text);
}

.cat-sub-item:hover {
  background: var(--lp-surface-muted);
}

.cat-sub-name {
  flex: 1;
  font-size: 0.925rem;
  color: var(--lp-text);
}

.cat-sub-count {
  font-size: 0.75rem;
  color: var(--lp-text-muted);
  min-width: 1.5rem;
  text-align: right;
}

.cat-sub-editing {
  gap: 0.35rem;
  padding-left: 1rem;
}

.cat-sub-editing .input-field {
  flex: 1;
}

.cat-sub-empty {
  padding: 0.5rem 1.75rem;
  font-size: 0.875rem;
  color: var(--lp-text-muted);
}

.cat-add-sub {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px dashed var(--lp-border);
  background: #f1f5f9;
}

.cat-add-sub .input-field {
  flex: 1;
}

.categoria-parent-row td:first-child {
  font-weight: 600;
}

.categoria-sub-row td:first-child {
  padding-left: 2rem;
  color: var(--lp-text-muted);
}

.categoria-sub-row .categoria-sub-prefix {
  color: var(--lp-text-muted);
  margin-right: 0.35rem;
}

.categoria-parent-select {
  min-width: 160px;
}

/* Articoli — toggle brand/categoria e tab modale */
.filter-toggle {
  display: inline-flex;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-md);
  overflow: hidden;
  max-width: 100%;
}

.filter-toggle-btn {
  border: none;
  background: var(--lp-surface);
  padding: 8px 14px;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--lp-text-muted);
}

.date-group-subheader td {
  background: var(--lp-surface-muted);
  font-size: 0.875rem;
  padding-top: 6px;
  padding-bottom: 6px;
}

.giacenza-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.giacenza-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

html,
body {
  max-width: 100%;
}

.topbar-shell-left,
.topbar-shell-right,
.topbar-nav,
.topbar-user,
.articoli-top-strip,
.articoli-dashboard,
.articoli-toolbar .toolbar-left,
.articoli-toolbar-meta,
.col-picker-wrap,
.filter-select,
.toolbar-manage-btn,
.toolbar-check-label {
  min-width: 0;
  max-width: 100%;
}

body.modal-resizing {
  cursor: inherit;
  user-select: none;
}

.modal-overlay.modal-fullscreen .modal {
  width: 98vw;
  max-width: 98vw;
  height: 96vh;
  max-height: 96vh;
  resize: none;
  display: flex;
  flex-direction: column;
}

.modal-overlay.modal-fullscreen .modal-body {
  flex: 1;
  overflow: auto;
}

.modal-overlay.modal-fullscreen .matrix-table {
  font-size: 1.05rem;
}

.modal-overlay.modal-fullscreen .qty-input-matrix {
  width: 4.5rem;
  min-height: 2.5rem;
  font-size: 1.1rem;
  text-align: center;
}

.varianti-obsolete-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--lp-border);
}

.varianti-obsolete-section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #b45309;
}

.variante-obsolete-row {
  background: #fffbeb;
}

.btn-delete-variante:hover {
  color: #dc2626;
}

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--lp-border);
  margin-bottom: 1rem;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--lp-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn.active {
  color: var(--lp-primary-700);
  border-bottom-color: var(--lp-primary-600);
  font-weight: 600;
}

.tab-panel.hidden {
  display: none;
}

.tab-actions {
  margin-bottom: 0.75rem;
}

.wizard-steps {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--lp-border);
  margin: 1rem 0 1.25rem;
}

.wizard-step {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--lp-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-align: center;
}

.wizard-step:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.wizard-step.active {
  color: var(--lp-primary-700);
  border-bottom-color: var(--lp-primary-600);
  font-weight: 600;
}

.wizard-step.done:not(:disabled) {
  color: var(--lp-text);
}

.wizard-panel.hidden {
  display: none;
}

.wizard-hint {
  font-size: 0.875rem;
  color: var(--lp-text-muted);
  margin-bottom: 0.75rem;
}

.barcode-input {
  width: 100%;
  min-width: 120px;
  padding: 6px 8px;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
}

.qty-input-matrix {
  width: 64px;
  text-align: center;
  padding: 6px 8px;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-sm);
  font-family: inherit;
}

.matrix-table th,
.matrix-table td {
  text-align: center;
  min-width: 48px;
}

.matrix-table th:first-child {
  text-align: left;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8125rem;
}

.articoli-alerts-card {
  margin-bottom: 1.5rem;
  padding: 1.1rem 1.2rem;
}

.articoli-alerts-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.articoli-alerts-head h2 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.articoli-alerts-head p {
  margin: 0;
  color: var(--lp-text-muted);
  font-size: 0.9rem;
}

.articoli-alerts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.alert-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--lp-border);
  background: var(--lp-surface);
  color: var(--lp-text);
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.alert-pill:hover,
.alert-pill.is-active,
.stat-card.is-active {
  border-color: var(--lp-primary-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.settings-hero {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  color: var(--lp-text-muted);
  font-weight: 700;
}

.settings-hero h1 {
  font-size: 1.65rem;
  margin-bottom: 0.5rem;
}

.settings-hero-copy {
  margin: 0;
  color: var(--lp-text-muted);
  max-width: 52rem;
}

.settings-hero-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
}

.settings-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: var(--lp-surface-muted);
  border: 1px solid var(--lp-border);
  font-weight: 600;
}

.settings-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.settings-sidebar {
  padding: 0.9rem;
  position: sticky;
  top: 1rem;
}

.settings-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--lp-text);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.settings-nav-btn:hover,
.settings-nav-btn.active {
  background: var(--lp-surface-muted);
  border-color: var(--lp-border);
}

.settings-panels {
  display: block;
  min-width: 0;
}

.settings-panel {
  display: none;
  gap: 1rem;
}

.settings-panel.active {
  display: grid;
}

.settings-card {
  padding: 1.35rem;
}

.settings-card-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.settings-card-head p {
  margin: 0.25rem 0 0;
  color: var(--lp-text-muted);
}

.settings-form-grid {
  display: grid;
  gap: 1rem;
}

.settings-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.settings-logo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.settings-logo-preview {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 1px dashed var(--lp-border);
  background: var(--lp-surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--lp-text-muted);
}

.settings-logo-preview.has-logo {
  border-style: solid;
  background: white;
}

.settings-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--lp-border);
  border-radius: 12px;
  background: var(--lp-surface-muted);
}

.settings-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.settings-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.settings-device-meta {
  background: var(--lp-surface-muted);
  border: 1px solid var(--lp-border);
  border-radius: 12px;
  padding: 1rem;
}

.settings-meta-label {
  display: block;
  color: var(--lp-text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}

@media (max-width: 960px) {
  .settings-hero,
  .articoli-alerts-head {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    position: static;
  }
}
