/* documenti.css */

.doc-page-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--color-border);
}
.doc-header-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  flex-wrap: wrap;
}

/* Badge fonte */
.doc-source-badge {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 14px;
  background: rgba(74,222,128,0.07);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 20px;
  font-size: 0.78rem; color: #4ade80;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 10px;
}

/* Body */
.doc-body { padding: 40px 0 80px; }

/* Avviso DB fallback */
.doc-notice {
  display: flex; align-items: flex-start; gap: 14px;
  background: rgba(174,135,68,0.06);
  border: 1px solid rgba(174,135,68,0.18);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 28px;
  color: var(--color-gold-light);
}
.doc-notice svg { flex-shrink: 0; margin-top: 1px; }
.doc-notice-title {
  font-size: 0.88rem; font-weight: var(--font-weight-semi);
  margin-bottom: 4px;
}
.doc-notice-desc {
  font-size: 0.82rem; color: var(--color-text-muted); line-height: 1.6;
}

/* Stato vuoto */
.doc-empty {
  text-align: center; padding: 80px 0;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.doc-empty-icon {
  width: 88px; height: 88px;
  background: rgba(174,135,68,0.06);
  border: 1px solid rgba(174,135,68,0.12);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-dim);
  margin-bottom: 4px;
}
.doc-empty-title {
  font-size: 1.1rem; font-weight: var(--font-weight-semi);
  color: var(--color-text);
}
.doc-empty-desc {
  font-size: 0.88rem; color: var(--color-text-muted);
  max-width: 360px; line-height: 1.6;
}
.doc-empty-cta { margin-top: 8px; }

/* Sommario */
.doc-summary {
  display: flex; align-items: center; gap: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 20px 32px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.doc-summary-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0 28px; flex: 1;
}
.doc-summary-item:first-child { padding-left: 0; }
.doc-summary-item:last-child  { padding-right: 0; }
.doc-summary-val {
  font-size: 1.4rem; font-weight: var(--font-weight-bold);
  background: var(--gradient-gold-text);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1;
}
.doc-summary-label { font-size: 0.74rem; color: var(--color-text-dim); }
.doc-summary-sep { width: 1px; height: 40px; background: var(--color-border); }

/* Card tabella */
.doc-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}

/* Tabella */
.doc-table {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
}
.doc-table thead tr {
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--color-border);
}
.doc-table thead th {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: var(--font-weight-semi);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  white-space: nowrap;
}
.doc-th-actions { text-align: right; }
.doc-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
}
.doc-table tbody tr:hover { background: rgba(174,135,68,0.03); }
.doc-table tbody tr:last-child { border-bottom: none; }
.doc-table td { padding: 16px 20px; color: var(--color-text-muted); vertical-align: middle; }

/* Colonne specifiche */
.td-numero {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--color-text-dim);
  letter-spacing: 0.04em;
}
.td-data { white-space: nowrap; font-size: 0.84rem; }
.td-desc { max-width: 220px; }
.td-importo {
  font-weight: var(--font-weight-semi);
  color: var(--color-text);
  white-space: nowrap;
}
.td-importo .importo-na { color: var(--color-text-dim); font-size: 0.8rem; }
.td-actions { text-align: right; white-space: nowrap; }

/* Badge stato */
.doc-stato {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: var(--font-weight-semi);
  white-space: nowrap;
}
.stato-pagato    { background: rgba(74,222,128,0.1); color: #4ade80; border: 1px solid rgba(74,222,128,0.2); }
.stato-registrato { background: rgba(174,135,68,0.1); color: var(--color-gold-light); border: 1px solid rgba(174,135,68,0.2); }
.stato-attesa    { background: rgba(251,191,36,0.1); color: #fbbf24; border: 1px solid rgba(251,191,36,0.2); }
.stato-void      { background: rgba(255,255,255,0.05); color: var(--color-text-dim); border: 1px solid var(--color-border); }
.stato-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Bottone download */
.doc-btn-download {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: rgba(174,135,68,0.08);
  border: 1px solid rgba(174,135,68,0.2);
  border-radius: 7px;
  color: var(--color-gold-light);
  font-size: 0.8rem;
  font-weight: var(--font-weight-medium);
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.doc-btn-download:hover {
  background: rgba(174,135,68,0.15);
  border-color: rgba(174,135,68,0.4);
}
.doc-btn-download:disabled,
.doc-btn-download.disabled {
  opacity: 0.35; cursor: not-allowed; pointer-events: none;
}

/* Nota legale */
.doc-legal-note {
  font-size: 0.78rem; color: var(--color-text-dim);
  text-align: center; line-height: 1.7; padding: 0 20px;
}
.doc-legal-note a { color: var(--color-gold-dark); transition: color var(--transition); }
.doc-legal-note a:hover { color: var(--color-gold-light); }

/* Responsive */
@media (max-width: 800px) {
  .doc-table thead { display: none; }
  .doc-table tbody tr { display: block; padding: 14px 16px; }
  .doc-table td { display: block; padding: 4px 0; border: none; font-size: 0.85rem; }
  .td-actions { text-align: left; padding-top: 10px; }
  .doc-summary { padding: 16px; }
  .doc-summary-item { padding: 8px 12px; }
  .doc-summary-sep { display: none; }
}
