/* Elenco FIC: anno, ricerca, occhio PDF, righe compatte (proforma/fattura/nc/autofatture) */
.gp-doc-head h2 { margin-bottom: 4px; }
.gp-year-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}
.gp-year-btn {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.4rem;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #1a1a2e;
  cursor: pointer;
  line-height: 1.15;
  -webkit-appearance: none;
  appearance: none;
}
.gp-year-btn-y { font-size: 13px; font-weight: 800; }
.gp-year-btn-n { font-size: 11px; color: #6b7280; font-weight: 600; }
.gp-year-btn:hover { border-color: #7c3aed; color: #5b21b6; }
.gp-year-btn.is-active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}
.gp-year-btn.is-active .gp-year-btn-n { color: #ede9fe; }

.gp-doc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: flex-end;
}
.gp-doc-filters .gp-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
}
.gp-doc-filters .gp-field span {
  font-size: 11px;
  font-weight: 700;
  color: #4b5563;
}
.gp-doc-filters .gp-field--sm { flex: 0 0 auto; width: 7.2rem; }
.gp-doc-filters .gp-field--sm input { width: 100%; max-width: 7.2rem; }
.gp-doc-filters .gp-field--fill { flex: 1 1 12rem; min-width: min(100%, 10rem); }
.gp-doc-filters .gp-field--fill input { width: 100%; }
.gp-doc-filters input {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}
.gp-doc-filters .gp-btn { flex: 0 0 auto; min-height: 40px; }

.gp-doc-list-card { padding: 8px 10px 12px; }
.gp-table-wrap { overflow-x: auto; max-width: 100%; }

.gp-doc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.gp-doc-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #5b21b6;
  background: #f5f3ff;
  border-bottom: 1px solid #e9d5ff;
  white-space: nowrap;
}
.gp-doc-table .gp-col-prev {
  width: 2.8rem;
  text-align: center;
  white-space: nowrap;
}
.gp-doc-table .gp-col-doc { width: 9.5rem; }
.gp-doc-table .gp-col-cli { min-width: 8rem; }
.gp-doc-table .gp-col-td {
  width: 4.2rem;
  text-align: center;
}
.gp-doc-table .gp-col-imp {
  width: 7.2rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gp-doc-table .gp-col-act {
  width: 6.4rem;
  text-align: right;
  white-space: nowrap;
}

.gp-doc-table tbody td {
  padding: 8px 10px;
  vertical-align: middle;
  border-bottom: 1px solid #eeeef2;
  background: #fff;
}
.gp-doc-table tbody tr:nth-child(even) td { background: #faf9fc; }
.gp-doc-table tbody tr.gp-doc-row:hover td {
  background: #f3e8ff;
}
.gp-doc-table tbody tr[data-fic]:not([data-fic=""]) { cursor: pointer; }

.gp-doc-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #f3e8ff;
  color: #6b21a8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.gp-doc-eye:hover { background: #e9d5ff; }
.gp-doc-eye-off { color: #c4c4cc; font-weight: 700; }

.gp-doc-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #c0392b;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  -webkit-appearance: none;
  appearance: none;
}
.gp-doc-del:hover { background: #a93226; }
.gp-doc-del:disabled { opacity: 0.55; cursor: wait; }

.gp-doc-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.gp-doc-num {
  color: #e67800;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  text-decoration: none;
  line-height: 1.2;
}
.gp-doc-num.is-plain { color: #1a1a2e; }
.gp-doc-num:hover { text-decoration: underline; }
.gp-doc-date {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gp-col-cli {
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
}
.gp-col-imp {
  font-weight: 800;
  font-size: 14px;
  color: #1a1a2e;
}
.gp-doc-td {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.gp-doc-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.gp-doc-meta { font-size: 12px; color: #6b7280; font-weight: 600; }
.gp-doc-riepilogo summary {
  cursor: pointer;
  font-weight: 700;
  color: #374151;
}
.gp-doc-riepilogo .gp-table { margin-top: 10px; }

@media (max-width: 900px), (max-width: 1100px) and (pointer: coarse) {
  .gp-year-btn { min-height: 40px; }
  .gp-doc-filters input { font-size: 16px; min-height: 40px; }

  .gp-doc-table thead { display: none; }
  .gp-doc-table,
  .gp-doc-table tbody {
    display: block;
    width: 100%;
  }
  .gp-doc-table tbody tr.gp-doc-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas:
      "prev doc imp"
      "prev cli imp"
      "prev td  del";
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
    margin: 0 0 8px;
    padding: 10px 10px 10px 8px;
    border: 1px solid #ece8f4;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(91, 33, 182, 0.04);
  }
  .gp-doc-table tbody tr.gp-doc-row td {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent !important;
  }
  .gp-doc-table tbody tr:nth-child(even).gp-doc-row { background: #fff; }
  .gp-doc-table tbody tr.gp-doc-row:hover { background: #faf7ff; }
  .gp-doc-table .gp-col-prev { grid-area: prev; width: auto; }
  .gp-doc-table .gp-col-doc { grid-area: doc; width: auto; }
  .gp-doc-table .gp-col-cli {
    grid-area: cli;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
  }
  .gp-doc-table .gp-col-td { grid-area: td; width: auto; text-align: left; }
  .gp-doc-table .gp-col-imp {
    grid-area: imp;
    width: auto;
    font-size: 15px;
    align-self: start;
    padding-top: 4px;
  }
  .gp-doc-table .gp-col-act {
    grid-area: del;
    width: auto;
    text-align: left;
    padding-top: 6px;
  }
  .gp-doc-table:not(.gp-doc-table--td) tbody tr.gp-doc-row {
    grid-template-areas:
      "prev doc imp"
      "prev cli del";
  }
  .gp-doc-table tbody tr:not(.gp-doc-row) { display: block; }
  .gp-doc-table tbody tr .gp-empty {
    display: block;
    padding: 20px 8px;
    text-align: center;
  }
}
