/* ===== Simulatore Badanti CCNL – Frontend CSS ===== */
:root {
  --sim-bg:      #fff;
  --sim-text:    #111;
  --sim-muted:   #6b7280;
  --sim-line:    #e5e7eb;
  --sim-brand:   #111;
  --sim-blue:    #2563eb;
  --sim-green:   #22c55e;
  --sim-error:   #dc2626;
  --sim-chip:    #f1f5f9;
  --sim-chip-b:  #e2e8f0;
  --sim-chip-t:  #0f172a;
}

#sim-ld {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--sim-line);
  border-radius: 12px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
  background: var(--sim-bg);
  color: var(--sim-text);
  box-sizing: border-box;
}

#sim-ld h2 { margin: 0 0 6px 0; }

#sim-ld .sim-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#sim-ld .sim-row-contacts {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
  margin: 8px 0 6px 0;
}

#sim-ld label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  font-weight: 500;
}

#sim-ld input,
#sim-ld select {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  background: #fff;
  color: #111;
  box-sizing: border-box;
}

#sim-ld input.sim-error,
#sim-ld select.sim-error {
  border-color: var(--sim-error);
  outline-color: var(--sim-error);
}

#sim-ld .sim-help {
  font-size: 12px;
  color: var(--sim-muted);
}

#sim-ld .sim-error-msg {
  font-size: 12px;
  color: var(--sim-error);
  display: none;
  margin-top: 4px;
}

#sim-ld fieldset {
  border: 1px solid var(--sim-line);
  border-radius: 10px;
  padding: 10px;
  margin: 0;
}

#sim-ld .sim-flex {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
#sim-ld .sim-btn {
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  border: 1px solid var(--sim-brand);
  background: var(--sim-brand);
  color: #fff;
  transition: opacity .15s;
}
#sim-ld .sim-btn.sim-btn-outline {
  background: #fff;
  color: var(--sim-text);
  border-color: #9ca3af;
}
#sim-ld .sim-btn.sim-btn-blue {
  border-color: var(--sim-blue);
  background: var(--sim-blue);
}
#sim-ld .sim-btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
}

/* Output area */
#sim-out {
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--sim-line);
  border-radius: 10px;
  padding: 14px;
  color: #111;
}

#sim-out table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  color: #111;
}
#sim-out th,
#sim-out td {
  padding: 8px 0;
  background: #fff;
  color: #111;
  border-bottom: 1px solid var(--sim-line);
}
#sim-out thead th { border-bottom: 1px solid var(--sim-line); }
#sim-out td:last-child { text-align: right; }

/* Chips */
#sim-ld .sim-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}
#sim-ld .sim-chip {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--sim-chip-b);
  background: var(--sim-chip);
  border-radius: 999px;
  color: var(--sim-chip-t);
}

/* Muted text */
#sim-ld .sim-muted {
  color: var(--sim-muted);
  font-size: 12px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #sim-ld .sim-grid { grid-template-columns: 1fr; }
  #sim-ld .sim-row-contacts { grid-template-columns: 1fr; gap: 10px; }
  #sim-ld input,
  #sim-ld select { font-size: 16px; padding: 12px; }
  #sim-ld .sim-btn { width: 100%; font-size: 16px; }
  #sim-out { padding: 12px; }
  #sim-out .sim-table-wrap { overflow-x: auto; }
  #sim-out table { min-width: 560px; }
}
