.articoli-panel {
  grid-column: 1 / -1;
}

.articoli-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.articoli-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
  gap: 12px;
  width: 100%;
  padding: 8px 0 6px;
  background: transparent;
}

.articoli-filter-group {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: #f6f8fc;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.articoli-filter-label {
  font-size: 11px;
  color: #6b7a90;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.articoli-filter-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.articoli-filter-field input {
  min-height: 32px;
  font-size: 12px;
  min-width: 0;
  width: 100%;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 6px 10px;
}

.articoli-filter-clear {
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  line-height: 1;
  font-size: 14px;
  border-radius: 10px;
  border: none;
  background: #eef2f7;
  color: #516075;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.articoli-filter-clear:hover {
  background: #e0e7f2;
}

.articoli-filter-action {
  align-self: center;
  justify-self: end;
}

.articoli-count {
  font-size: 12px;
  color: #6b7a90;
  justify-self: end;
}

.articoli-btn {
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.articoli-btn.ghost {
  background: #eef2f7;
  border-color: rgba(148, 163, 184, 0.28);
  color: #2b3a52;
}

.articoli-btn.ghost:hover {
  background: #e1e8f2;
  box-shadow: 0 6px 16px rgba(20, 40, 70, 0.08);
}

.articoli-btn.primary {
  border: none;
  background: linear-gradient(135deg, #1f5c35 0%, #2d7a48 100%);
  box-shadow: 0 8px 18px rgba(31, 92, 53, 0.18);
}

.articoli-btn.primary:hover {
  background: linear-gradient(135deg, #1b512f 0%, #256a3f 100%);
}

.articoli-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  max-height: calc(100vh - 210px);
  background: var(--card);
}

.articoli-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
}

.articoli-table th,
.articoli-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
  font-size: 12px;
}

.articoli-table th:last-child,
.articoli-table td:last-child {
  border-right: none;
}

.articoli-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #eef3fb;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3f4d64;
}

.articoli-table tbody tr:nth-child(even) {
  background: #fafcff;
}

.articoli-code {
  font-family: var(--mono);
  font-size: 11px;
}

.articoli-desc {
  color: var(--ink);
  line-height: 1.25;
}

.articoli-subdesc {
  color: var(--muted);
  line-height: 1.25;
}

.articoli-updated {
  color: var(--muted);
  font-size: 11px;
}

.articoli-import-card {
  width: min(1100px, 96vw);
}

.articoli-add-card {
  width: min(640px, 96vw);
}

.articoli-add-body {
  display: grid;
  gap: 12px;
}

.articoli-add-grid {
  display: grid;
  gap: 10px;
}

.articoli-field {
  display: grid;
  gap: 4px;
}

.articoli-field span {
  font-size: 12px;
  color: var(--muted);
}

.articoli-field input {
  min-height: 34px;
  font-size: 12px;
}

.articoli-import-body {
  display: grid;
  gap: 10px;
}

.articoli-import-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.articoli-import-header {
  font-size: 11px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #f8faff;
  padding: 8px;
  overflow-x: auto;
  white-space: nowrap;
}

#articoliImportTextarea {
  width: 100%;
  min-height: 180px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
}

.articoli-import-preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 320px;
  overflow: auto;
  background: var(--card);
}

.articoli-import-preview-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 800px;
}

.articoli-import-preview-table th,
.articoli-import-preview-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  vertical-align: top;
}

.articoli-import-preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #eef3fb;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #3f4d64;
}

.articoli-import-preview-row-ok {
  background: #f3fbf6;
}

.articoli-import-preview-row-error {
  background: #fff2f2;
}

.articoli-import-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid transparent;
}

.articoli-import-badge-ok {
  color: #1f5c35;
  background: #e8f7ee;
  border-color: #b8e3c9;
}

.articoli-import-badge-error {
  color: #8a2d2d;
  background: #ffe7e7;
  border-color: #f2b8b8;
}

.articoli-import-issue {
  color: #8a2d2d;
  font-weight: 600;
}

body.theme-dark .articoli-table thead th,
body.theme-dark .articoli-import-preview-table thead th {
  background: #151c27;
  color: #c7d2e3;
}

body.theme-dark .articoli-table tbody tr:nth-child(even) {
  background: #111823;
}

body.theme-dark .articoli-import-header {
  background: #121a26;
  border-color: #2d3a52;
}

body.theme-dark .articoli-import-preview-row-ok {
  background: #141f1a;
}

body.theme-dark .articoli-import-preview-row-error {
  background: #2a171c;
}

body.theme-dark .articoli-filters {
  background: transparent;
}

body.theme-dark .articoli-filter-group {
  background: #141b26;
  box-shadow: inset 0 0 0 1px rgba(71, 85, 105, 0.5);
}

body.theme-dark .articoli-filter-clear {
  background: #1a2436;
  color: #e2e8f0;
  box-shadow: inset 0 0 0 1px rgba(71, 85, 105, 0.7);
}

body.theme-dark .articoli-filter-clear:hover {
  background: #233149;
}

body.theme-dark .articoli-filter-field input {
  background: #0f1622;
  border-color: rgba(71, 85, 105, 0.75);
  color: #e2e8f0;
}

body.theme-dark .articoli-filter-label,
body.theme-dark .articoli-count {
  color: #a5b4c4;
}

body.theme-dark .articoli-table-wrap,
body.theme-dark .articoli-import-preview,
body.theme-dark .articoli-import-card,
body.theme-dark .articoli-add-card {
  background: #0f1622;
  border-color: #2a364c;
}

body.theme-dark .articoli-table th,
body.theme-dark .articoli-table td {
  border-color: #243149;
}

body.theme-dark .articoli-btn.ghost {
  background: #1a2436;
  border-color: rgba(71, 85, 105, 0.8);
  color: #e2e8f0;
}

body.theme-dark .articoli-btn.ghost:hover {
  background: #233149;
  box-shadow: 0 6px 16px rgba(3, 7, 18, 0.55);
}

body.theme-dark .articoli-btn.primary {
  background: linear-gradient(135deg, #1a5f35 0%, #2b814a 100%);
  box-shadow: 0 8px 18px rgba(12, 64, 33, 0.55);
}

@media (max-width: 920px) {
  .articoli-filters {
    align-items: stretch;
  }

  .articoli-filter-action {
    width: 100%;
    justify-self: stretch;
  }

  .articoli-count {
    width: 100%;
    justify-self: start;
  }
}
