/* ========================================================
   1. VARIABILI GLOBALI E CONFIGURAZIONE CROMATICA
   ======================================================== */
:root {
  --primary: #2563eb;       
  --bg: #f8fafc;            
  --card-bg: #ffffff;       
  --text: #1e293b;          
  --border: #cbd5e1;        
  --gray-light: #f1f5f9;    
}
/* ========================================================
   2. STILI BASE E TIPOGRAFIA
   ======================================================== */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 20px;
  line-height: 1.5;
}

#app {
  max-width: 800px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

h1 {
  color: #1e3a8a;
  margin-bottom: 20px;
}

.subtitle {
  color: #64748b;
  margin-top: -10px;
  margin-bottom: 20px;
  font-size: 14px;
}
/* ========================================================
   3. MENU DI NAVIGAZIONE PRINCIPALE
   ======================================================== */
.main-menu {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
/* ========================================================
   4. BOTTONI E COMPONENTI INTERATTIVI
   ======================================================== */
button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.2s, background-color 0.2s;
}

button:hover {
  opacity: 0.9;
}

.btn-nav {
  background-color: var(--primary);
}

.btn-submit {
  background-color: var(--primary);
  width: 100%;
  margin-top: 10px;
}

.btn-close {
  background-color: #ef4444; 
}

.btn-logout {
  background-color: #64748b; 
  padding: 8px 16px;
  font-size: 14px;
}

.btn-view {
  background-color: #10b981; 
  margin-top: 15px;
  font-size: 14px;
  padding: 10px;
  width: 100%;
}
/* ========================================================
   5. STRUTTURA DELLE SCHERMATE (MOSTRA/NASCONDI)
   ======================================================== */
.app-section {
  display: none; 
  background: var(--card-bg);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

.app-section.active {
  display: block; 
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
/* ========================================================
   6. ELEMENTI DEI MODULI E INPUT DI TESTO
   ======================================================== */
.form-group {
  margin-bottom: 15px;
  text-align: left;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

input, textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 14px;
}

.select-style {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  font-size: 14px;
}

#search-bar {
  margin-bottom: 20px;
  padding: 12px;
  font-size: 16px;
  border: 1px solid var(--border);
}
#nome-file-selezionato {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-style: italic;
}
/* ========================================================
   7. GRIGLIA E CARTELLINI DEI PROTOCOLLI (RESPONSIVE)
   ======================================================== */
.grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr; 
  gap: 15px;
}

@media (max-width: 600px) {
  .grid-container {
    grid-template-columns: 1fr; 
  }
}

.protocollo-card {
  border: 1px solid #e2e8f0;
  padding: 20px;
  border-radius: 8px;
  background: var(--gray-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.badge {
  align-self: flex-start;
  background: #dbeafe;
  color: #1e40af;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 10px;
}
/* ========================================================
   8. VISUALIZZATORE DOCUMENTO WORD CONVERTITO
   ======================================================== */
.document-body {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 25px;
  border-radius: 8px;
  min-height: 300px;
  line-height: 1.6;
  text-align: left;
  overflow-y: auto;
}

.document-body h1, .document-body h2, .document-body h3 {
  color: #1e3a8a;
  margin-top: 20px;
}

.document-body p {
  margin-bottom: 12px;
  color: #334155;
}

.document-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.document-body table, .document-body th, .document-body td {
  border: 1px solid var(--border);
  padding: 8px;
}
/* ========================================================
   9. STILI AGGIUNTIVI PER LA CANCELLAZIONE (ADMIN)
   ======================================================== */
.admin-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: var(--gray-light);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 10px;
}
.admin-item-info {
  text-align: left;
}
.admin-item-info h4 {
  margin: 0 0 4px 0;
  color: #1e3a8a;
}
.btn-delete {
  background-color: #ef4444;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
}

/* ========================================================
   10. TAB DEL PANNELLO AMMINISTRATORE
   ======================================================== */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e2e8f0;
  margin: 10px 0 25px 0;
  flex-wrap: wrap;
}
.tab-btn {
  background: transparent;
  color: #64748b;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: -2px;
}
.tab-btn:hover { opacity: 1; color: var(--primary); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-badge {
  display: inline-block;
  background: #f59e0b;
  color: white;
  font-size: 12px;
  font-weight: bold;
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 4px;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* status badge + selettore nella lista utenti */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
}
.status-approved { background: #dcfce7; color: #166534; }
.status-pending  { background: #fef3c7; color: #92400e; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  font-size: 13px;
}
.you-tag {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}
#users-search {
  margin: 5px 0 18px 0;
  padding: 12px;
  font-size: 15px;
  border: 1px solid var(--border);
}
