*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background: #f3f4f6;
  padding: 24px;
  color: #111;
  font-size: 14px;
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #111;
}

.btn-back {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
}

.btn-back:hover {
  background: #f3f4f6;
}

/* TABS */
.tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  padding: 0 20px;
  background: #fff;
}

.tab {
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  font-weight: 500;
}

.tab.active {
  color: #111;
  border-bottom-color: #111;
}

.tab:hover:not(.active) {
  color: #374151;
}

/* TOOLBAR */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  cursor: pointer;
  font-weight: 500;
}

.btn:hover {
  background: #f3f4f6;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-dark {
  background: #374151;
  color: #fff;
  border-color: #374151;
}

.btn-dark:hover {
  background: #1f2937;
}

/* TABLE */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead tr {
  background: #f9fafb;
}

th {
  padding: 9px 12px;
  text-align: left;
  font-weight: 600;
  color: #6b7280;
  font-size: 12px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

th .sort-icon {
  opacity: .45;
  font-size: 10px;
  margin-left: 3px;
}

td {
  padding: 9px 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #111;
  vertical-align: middle;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: #f9fafb;
}

/* BADGE */
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.badge-vistato {
  background: #dcfce7;
  color: #166534;
}

.badge-inserito {
  background: #dbeafe;
  color: #1e40af;
}

.badge-annullato {
  background: #fee2e2;
  color: #991b1b;
}

/* ACTION BUTTONS */
.actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.act-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.act-btn.view {
  background: #16a34a;
}

.act-btn.list {
  background: #dc2626;
}

.act-btn.del {
  background: #ef4444;
}

/* PAGINATION */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 10px 20px;
  border-top: 1px solid #e5e7eb;
}

.pg-btn {
  min-width: 36px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  padding: 0 8px;
}

.pg-btn.active {
  background: #374151;
  color: #fff;
  border-color: #374151;
}

.pg-btn:hover:not(.active) {
  background: #f3f4f6;
}

input[type=checkbox] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #2563eb;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}